From e46be2dc1823d07bf5f3b97c667528a1c4e8993f Mon Sep 17 00:00:00 2001 From: fern-support <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 22 Jan 2025 11:20:08 -0500 Subject: [PATCH] Add legacy SDK in legacy/ --- legacy/CHANGELOG.md | 618 +++++++++++ legacy/README.md | 157 +++ legacy/doc/api-error.md | 18 + legacy/doc/api-response.md | 15 + legacy/doc/api/apple-pay.md | 65 ++ legacy/doc/api/bank-accounts.md | 139 +++ legacy/doc/api/booking-custom-attributes.md | 606 +++++++++++ legacy/doc/api/bookings.md | 636 ++++++++++++ legacy/doc/api/cards.md | 207 ++++ legacy/doc/api/cash-drawers.md | 166 +++ legacy/doc/api/catalog.md | 936 +++++++++++++++++ legacy/doc/api/checkout.md | 561 ++++++++++ legacy/doc/api/customer-custom-attributes.md | 575 +++++++++++ legacy/doc/api/customer-groups.md | 235 +++++ legacy/doc/api/customer-segments.md | 95 ++ legacy/doc/api/customers.md | 818 +++++++++++++++ legacy/doc/api/devices.md | 235 +++++ legacy/doc/api/disputes.md | 429 ++++++++ legacy/doc/api/employees.md | 99 ++ legacy/doc/api/events.md | 170 +++ legacy/doc/api/gift-card-activities.md | 122 +++ legacy/doc/api/gift-cards.md | 339 ++++++ legacy/doc/api/inventory.md | 690 +++++++++++++ legacy/doc/api/invoices.md | 596 +++++++++++ legacy/doc/api/labor.md | 851 +++++++++++++++ legacy/doc/api/location-custom-attributes.md | 605 +++++++++++ legacy/doc/api/locations.md | 222 ++++ legacy/doc/api/loyalty.md | 976 ++++++++++++++++++ legacy/doc/api/merchant-custom-attributes.md | 603 +++++++++++ legacy/doc/api/merchants.md | 102 ++ legacy/doc/api/mobile-authorization.md | 63 ++ legacy/doc/api/o-auth.md | 193 ++++ legacy/doc/api/order-custom-attributes.md | 634 ++++++++++++ legacy/doc/api/orders.md | 539 ++++++++++ legacy/doc/api/payments.md | 412 ++++++++ legacy/doc/api/payouts.md | 156 +++ legacy/doc/api/refunds.md | 168 +++ legacy/doc/api/sites.md | 48 + legacy/doc/api/snippets.md | 160 +++ legacy/doc/api/subscriptions.md | 631 +++++++++++ legacy/doc/api/team.md | 721 +++++++++++++ legacy/doc/api/terminal.md | 692 +++++++++++++ legacy/doc/api/transactions.md | 227 ++++ legacy/doc/api/v1-transactions.md | 169 +++ legacy/doc/api/vendors.md | 340 ++++++ legacy/doc/api/webhook-subscriptions.md | 389 +++++++ legacy/doc/auth/oauth-2-bearer-token.md | 32 + legacy/doc/client.md | 136 +++ legacy/doc/models/accept-dispute-response.md | 64 ++ legacy/doc/models/accepted-payment-methods.md | 27 + .../accumulate-loyalty-points-request.md | 31 + .../accumulate-loyalty-points-response.md | 99 ++ legacy/doc/models/ach-details.md | 27 + legacy/doc/models/action-cancel-reason.md | 15 + legacy/doc/models/activity-type.md | 70 ++ .../models/add-group-to-customer-response.md | 31 + legacy/doc/models/additional-recipient.md | 32 + legacy/doc/models/address.md | 41 + .../models/adjust-loyalty-points-request.md | 31 + .../models/adjust-loyalty-points-response.md | 63 ++ legacy/doc/models/afterpay-details.md | 23 + ...ication-details-external-square-product.md | 24 + legacy/doc/models/application-details.md | 25 + legacy/doc/models/application-type.md | 13 + legacy/doc/models/appointment-segment.md | 34 + legacy/doc/models/archived-state.md | 19 + legacy/doc/models/availability.md | 36 + .../models/bank-account-payment-details.md | 34 + legacy/doc/models/bank-account-status.md | 17 + legacy/doc/models/bank-account-type.md | 19 + legacy/doc/models/bank-account.md | 55 + .../models/batch-change-inventory-request.md | 67 ++ .../models/batch-change-inventory-response.md | 72 ++ .../batch-delete-catalog-objects-request.md | 24 + .../batch-delete-catalog-objects-response.md | 35 + .../batch-retrieve-catalog-objects-request.md | 32 + ...batch-retrieve-catalog-objects-response.md | 276 +++++ ...atch-retrieve-inventory-changes-request.md | 41 + ...tch-retrieve-inventory-changes-response.md | 73 ++ ...batch-retrieve-inventory-counts-request.md | 37 + ...atch-retrieve-inventory-counts-response.md | 34 + .../models/batch-retrieve-orders-request.md | 29 + .../models/batch-retrieve-orders-response.md | 121 +++ .../batch-upsert-catalog-objects-request.md | 261 +++++ .../batch-upsert-catalog-objects-response.md | 340 ++++++ legacy/doc/models/booking-booking-source.md | 18 + .../booking-creator-details-creator-type.md | 16 + legacy/doc/models/booking-creator-details.md | 27 + ...booking-custom-attribute-delete-request.md | 26 + ...ooking-custom-attribute-delete-response.md | 25 + ...booking-custom-attribute-upsert-request.md | 47 + ...ooking-custom-attribute-upsert-response.md | 64 ++ legacy/doc/models/booking-status.md | 20 + legacy/doc/models/booking.md | 44 + legacy/doc/models/break-type.md | 38 + legacy/doc/models/break.md | 35 + .../doc/models/bulk-create-customer-data.md | 38 + .../models/bulk-create-customers-request.md | 61 ++ .../models/bulk-create-customers-response.md | 150 +++ .../bulk-create-team-members-request.md | 60 ++ .../bulk-create-team-members-response.md | 95 ++ .../doc/models/bulk-create-vendors-request.md | 37 + .../models/bulk-create-vendors-response.md | 80 ++ ...elete-booking-custom-attributes-request.md | 28 + ...lete-booking-custom-attributes-response.md | 39 + .../models/bulk-delete-customers-request.md | 28 + .../models/bulk-delete-customers-response.md | 94 ++ ...ocation-custom-attribute-delete-request.md | 25 + ...lete-location-custom-attributes-request.md | 36 + ...cation-custom-attribute-delete-response.md | 26 + ...ete-location-custom-attributes-response.md | 46 + ...erchant-custom-attribute-delete-request.md | 25 + ...lete-merchant-custom-attributes-request.md | 32 + ...rchant-custom-attribute-delete-response.md | 25 + ...ete-merchant-custom-attributes-response.md | 48 + ...ributes-request-delete-custom-attribute.md | 25 + ...-delete-order-custom-attributes-request.md | 32 + ...delete-order-custom-attributes-response.md | 65 ++ .../models/bulk-retrieve-bookings-request.md | 27 + .../models/bulk-retrieve-bookings-response.md | 89 ++ .../models/bulk-retrieve-customers-request.md | 28 + .../bulk-retrieve-customers-response.md | 142 +++ ...ve-team-member-booking-profiles-request.md | 26 + ...e-team-member-booking-profiles-response.md | 59 ++ .../models/bulk-retrieve-vendors-request.md | 25 + .../models/bulk-retrieve-vendors-response.md | 109 ++ legacy/doc/models/bulk-swap-plan-request.md | 28 + legacy/doc/models/bulk-swap-plan-response.md | 39 + .../doc/models/bulk-update-customer-data.md | 39 + .../models/bulk-update-customers-request.md | 43 + .../models/bulk-update-customers-response.md | 135 +++ .../bulk-update-team-members-request.md | 58 ++ .../bulk-update-team-members-response.md | 99 ++ .../doc/models/bulk-update-vendors-request.md | 72 ++ .../models/bulk-update-vendors-response.md | 139 +++ ...psert-booking-custom-attributes-request.md | 70 ++ ...sert-booking-custom-attributes-response.md | 142 +++ ...ustomer-custom-attribute-upsert-request.md | 47 + ...sert-customer-custom-attributes-request.md | 47 + ...stomer-custom-attribute-upsert-response.md | 64 ++ ...ert-customer-custom-attributes-response.md | 154 +++ ...ocation-custom-attribute-upsert-request.md | 47 + ...sert-location-custom-attributes-request.md | 47 + ...cation-custom-attribute-upsert-response.md | 58 ++ ...ert-location-custom-attributes-response.md | 76 ++ ...erchant-custom-attribute-upsert-request.md | 47 + ...sert-merchant-custom-attributes-request.md | 93 ++ ...rchant-custom-attribute-upsert-response.md | 64 ++ ...ert-merchant-custom-attributes-response.md | 106 ++ ...ributes-request-upsert-custom-attribute.md | 45 + ...-upsert-order-custom-attributes-request.md | 93 ++ ...upsert-order-custom-attributes-response.md | 74 ++ ...ess-appointment-settings-alignment-time.md | 18 + ...ointment-settings-booking-location-type.md | 17 + ...ppointment-settings-cancellation-policy.md | 16 + ...ngs-max-appointments-per-day-limit-type.md | 16 + .../models/business-appointment-settings.md | 41 + ...business-booking-profile-booking-policy.md | 16 + ...ooking-profile-customer-timezone-choice.md | 16 + legacy/doc/models/business-booking-profile.md | 34 + legacy/doc/models/business-hours-period.md | 27 + legacy/doc/models/business-hours.md | 39 + .../doc/models/buy-now-pay-later-details.md | 31 + .../calculate-loyalty-points-request.md | 30 + .../calculate-loyalty-points-response.md | 46 + legacy/doc/models/calculate-order-request.md | 98 ++ legacy/doc/models/calculate-order-response.md | 231 +++++ legacy/doc/models/cancel-booking-request.md | 23 + legacy/doc/models/cancel-booking-response.md | 42 + legacy/doc/models/cancel-invoice-request.md | 23 + legacy/doc/models/cancel-invoice-response.md | 112 ++ .../cancel-loyalty-promotion-response.md | 81 ++ ...ncel-payment-by-idempotency-key-request.md | 24 + ...cel-payment-by-idempotency-key-response.md | 38 + legacy/doc/models/cancel-payment-response.md | 98 ++ .../models/cancel-subscription-response.md | 146 +++ .../models/cancel-terminal-action-response.md | 57 + .../cancel-terminal-checkout-response.md | 79 ++ .../models/cancel-terminal-refund-response.md | 69 ++ .../models/capture-transaction-response.md | 31 + legacy/doc/models/card-brand.md | 28 + legacy/doc/models/card-co-brand.md | 17 + legacy/doc/models/card-payment-details.md | 48 + legacy/doc/models/card-payment-timeline.md | 27 + legacy/doc/models/card-prepaid-type.md | 17 + legacy/doc/models/card-type.md | 17 + legacy/doc/models/card.md | 44 + legacy/doc/models/cash-app-details.md | 27 + legacy/doc/models/cash-drawer-device.md | 23 + legacy/doc/models/cash-drawer-event-type.md | 25 + legacy/doc/models/cash-drawer-shift-event.md | 33 + legacy/doc/models/cash-drawer-shift-state.md | 17 + .../doc/models/cash-drawer-shift-summary.md | 41 + legacy/doc/models/cash-drawer-shift.md | 50 + legacy/doc/models/cash-payment-details.md | 32 + .../doc/models/catalog-availability-period.md | 27 + legacy/doc/models/catalog-category-type.md | 17 + legacy/doc/models/catalog-category.md | 52 + ...tom-attribute-definition-app-visibility.md | 18 + ...stom-attribute-definition-number-config.md | 21 + ...ction-config-custom-attribute-selection.md | 25 + ...m-attribute-definition-selection-config.md | 38 + ...-attribute-definition-seller-visibility.md | 18 + ...stom-attribute-definition-string-config.md | 23 + ...atalog-custom-attribute-definition-type.md | 18 + .../catalog-custom-attribute-definition.md | 54 + .../models/catalog-custom-attribute-value.md | 36 + .../catalog-discount-modify-tax-basis.md | 14 + legacy/doc/models/catalog-discount-type.md | 18 + legacy/doc/models/catalog-discount.md | 49 + legacy/doc/models/catalog-ecom-seo-data.md | 27 + legacy/doc/models/catalog-id-mapping.md | 35 + legacy/doc/models/catalog-image.md | 34 + .../models/catalog-info-response-limits.md | 35 + legacy/doc/models/catalog-info-response.md | 76 ++ ...-preference-standard-dietary-preference.md | 21 + ...everage-details-dietary-preference-type.md | 16 + ...and-beverage-details-dietary-preference.md | 27 + ...-details-ingredient-standard-ingredient.md | 28 + ...em-food-and-beverage-details-ingredient.md | 27 + .../catalog-item-food-and-beverage-details.md | 44 + .../models/catalog-item-modifier-list-info.md | 43 + .../models/catalog-item-option-for-item.md | 24 + ...og-item-option-value-for-item-variation.md | 28 + .../doc/models/catalog-item-option-value.md | 33 + legacy/doc/models/catalog-item-option.md | 104 ++ .../doc/models/catalog-item-product-type.md | 23 + legacy/doc/models/catalog-item-variation.md | 56 + legacy/doc/models/catalog-item.md | 51 + legacy/doc/models/catalog-measurement-unit.md | 35 + .../catalog-modifier-list-modifier-type.md | 16 + .../catalog-modifier-list-selection-type.md | 16 + legacy/doc/models/catalog-modifier-list.md | 93 ++ .../doc/models/catalog-modifier-override.md | 25 + legacy/doc/models/catalog-modifier.md | 71 ++ legacy/doc/models/catalog-object-batch.md | 113 ++ legacy/doc/models/catalog-object-category.md | 27 + legacy/doc/models/catalog-object-reference.md | 27 + legacy/doc/models/catalog-object-type.md | 34 + legacy/doc/models/catalog-object.md | 153 +++ legacy/doc/models/catalog-pricing-rule.md | 42 + legacy/doc/models/catalog-pricing-type.md | 16 + legacy/doc/models/catalog-product-set.md | 41 + legacy/doc/models/catalog-query-exact.md | 25 + ...-item-variations-for-item-option-values.md | 27 + .../catalog-query-items-for-item-options.md | 26 + .../catalog-query-items-for-modifier-list.md | 27 + .../doc/models/catalog-query-items-for-tax.md | 26 + legacy/doc/models/catalog-query-prefix.md | 25 + legacy/doc/models/catalog-query-range.md | 27 + legacy/doc/models/catalog-query-set.md | 28 + .../models/catalog-query-sorted-attribute.md | 27 + legacy/doc/models/catalog-query-text.md | 25 + legacy/doc/models/catalog-query.md | 82 ++ .../doc/models/catalog-quick-amount-type.md | 16 + legacy/doc/models/catalog-quick-amount.md | 32 + .../catalog-quick-amounts-settings-option.md | 17 + .../models/catalog-quick-amounts-settings.md | 46 + legacy/doc/models/catalog-stock-conversion.md | 29 + .../catalog-subscription-plan-variation.md | 56 + .../doc/models/catalog-subscription-plan.md | 194 ++++ legacy/doc/models/catalog-tax.md | 46 + legacy/doc/models/catalog-time-period.md | 23 + legacy/doc/models/catalog-v1-id.md | 25 + .../doc/models/category-path-to-root-node.md | 25 + .../change-billing-anchor-date-request.md | 26 + .../change-billing-anchor-date-response.md | 94 ++ legacy/doc/models/change-timing.md | 16 + .../charge-request-additional-recipient.md | 31 + legacy/doc/models/charge-request.md | 73 ++ legacy/doc/models/charge-response.md | 187 ++++ ...location-settings-branding-button-shape.md | 15 + ...-location-settings-branding-header-type.md | 15 + .../checkout-location-settings-branding.md | 25 + .../checkout-location-settings-coupons.md | 21 + .../checkout-location-settings-policy.md | 25 + .../checkout-location-settings-tipping.md | 48 + .../doc/models/checkout-location-settings.md | 67 ++ ...ods-afterpay-clearpay-eligibility-range.md | 31 + ...tings-payment-methods-afterpay-clearpay.md | 45 + ...settings-payment-methods-payment-method.md | 23 + ...ckout-merchant-settings-payment-methods.md | 55 + .../doc/models/checkout-merchant-settings.md | 56 + .../models/checkout-options-payment-type.md | 20 + legacy/doc/models/checkout-options.md | 45 + legacy/doc/models/checkout.md | 37 + legacy/doc/models/clearpay-details.md | 23 + legacy/doc/models/clone-order-request.md | 28 + legacy/doc/models/clone-order-response.md | 333 ++++++ legacy/doc/models/collected-data.md | 21 + legacy/doc/models/complete-payment-request.md | 27 + .../doc/models/complete-payment-response.md | 107 ++ legacy/doc/models/component-component-type.md | 20 + legacy/doc/models/component.md | 54 + legacy/doc/models/confirmation-decision.md | 21 + legacy/doc/models/confirmation-options.md | 31 + legacy/doc/models/coordinates.md | 25 + legacy/doc/models/country.md | 265 +++++ ...ing-custom-attribute-definition-request.md | 34 + ...ng-custom-attribute-definition-response.md | 38 + legacy/doc/models/create-booking-request.md | 29 + legacy/doc/models/create-booking-response.md | 42 + .../doc/models/create-break-type-request.md | 34 + .../doc/models/create-break-type-response.md | 55 + legacy/doc/models/create-card-request.md | 47 + legacy/doc/models/create-card-response.md | 72 ++ .../models/create-catalog-image-request.md | 66 ++ .../models/create-catalog-image-response.md | 70 ++ legacy/doc/models/create-checkout-request.md | 179 ++++ legacy/doc/models/create-checkout-response.md | 172 +++ .../models/create-customer-card-request.md | 39 + .../models/create-customer-card-response.md | 56 + ...mer-custom-attribute-definition-request.md | 34 + ...er-custom-attribute-definition-response.md | 57 + .../models/create-customer-group-request.md | 31 + .../models/create-customer-group-response.md | 40 + legacy/doc/models/create-customer-request.md | 51 + legacy/doc/models/create-customer-response.md | 68 ++ .../doc/models/create-device-code-request.md | 30 + .../doc/models/create-device-code-response.md | 41 + .../create-dispute-evidence-file-request.md | 27 + .../create-dispute-evidence-file-response.md | 48 + .../create-dispute-evidence-text-request.md | 27 + .../create-dispute-evidence-text-response.md | 49 + .../create-gift-card-activity-request.md | 40 + .../create-gift-card-activity-response.md | 58 ++ legacy/doc/models/create-gift-card-request.md | 37 + .../doc/models/create-gift-card-response.md | 56 + .../create-invoice-attachment-request.md | 25 + .../create-invoice-attachment-response.md | 52 + legacy/doc/models/create-invoice-request.md | 83 ++ legacy/doc/models/create-invoice-response.md | 106 ++ legacy/doc/models/create-job-request.md | 31 + legacy/doc/models/create-job-response.md | 40 + ...ion-custom-attribute-definition-request.md | 34 + ...on-custom-attribute-definition-response.md | 45 + legacy/doc/models/create-location-request.md | 40 + legacy/doc/models/create-location-response.md | 74 ++ .../models/create-loyalty-account-request.md | 35 + .../models/create-loyalty-account-response.md | 46 + .../create-loyalty-promotion-request.md | 59 ++ .../create-loyalty-promotion-response.md | 75 ++ .../models/create-loyalty-reward-request.md | 33 + .../models/create-loyalty-reward-response.md | 47 + ...ant-custom-attribute-definition-request.md | 34 + ...nt-custom-attribute-definition-response.md | 45 + ...reate-mobile-authorization-code-request.md | 24 + ...eate-mobile-authorization-code-response.md | 41 + ...der-custom-attribute-definition-request.md | 34 + ...er-custom-attribute-definition-response.md | 56 + legacy/doc/models/create-order-request.md | 121 +++ legacy/doc/models/create-order-response.md | 329 ++++++ .../doc/models/create-payment-link-request.md | 83 ++ .../models/create-payment-link-response.md | 266 +++++ legacy/doc/models/create-payment-request.md | 68 ++ legacy/doc/models/create-payment-response.md | 114 ++ legacy/doc/models/create-refund-request.md | 35 + legacy/doc/models/create-refund-response.md | 68 ++ legacy/doc/models/create-shift-request.md | 56 + legacy/doc/models/create-shift-response.md | 82 ++ .../doc/models/create-subscription-request.md | 53 + .../models/create-subscription-response.md | 67 ++ .../doc/models/create-team-member-request.md | 63 ++ .../doc/models/create-team-member-response.md | 94 ++ .../models/create-terminal-action-request.md | 34 + .../models/create-terminal-action-response.md | 51 + .../create-terminal-checkout-request.md | 53 + .../create-terminal-checkout-response.md | 67 ++ .../models/create-terminal-refund-request.md | 36 + .../models/create-terminal-refund-response.md | 56 + legacy/doc/models/create-vendor-request.md | 37 + legacy/doc/models/create-vendor-response.md | 50 + .../create-webhook-subscription-request.md | 35 + .../create-webhook-subscription-response.md | 49 + legacy/doc/models/currency.md | 198 ++++ .../custom-attribute-definition-visibility.md | 20 + .../doc/models/custom-attribute-definition.md | 38 + legacy/doc/models/custom-attribute-filter.md | 41 + legacy/doc/models/custom-attribute.md | 46 + legacy/doc/models/custom-field.md | 25 + legacy/doc/models/customer-address-filter.md | 29 + .../models/customer-creation-source-filter.md | 32 + legacy/doc/models/customer-creation-source.md | 33 + .../customer-custom-attribute-filter-value.md | 58 ++ .../customer-custom-attribute-filter.md | 60 ++ .../customer-custom-attribute-filters.md | 63 ++ legacy/doc/models/customer-details.md | 25 + legacy/doc/models/customer-filter.md | 55 + legacy/doc/models/customer-group.md | 32 + .../models/customer-inclusion-exclusion.md | 17 + legacy/doc/models/customer-preferences.md | 23 + legacy/doc/models/customer-query.md | 53 + legacy/doc/models/customer-segment.md | 32 + legacy/doc/models/customer-sort-field.md | 16 + legacy/doc/models/customer-sort.md | 26 + legacy/doc/models/customer-tax-ids.md | 24 + legacy/doc/models/customer-text-filter.md | 27 + legacy/doc/models/customer.md | 54 + .../data-collection-options-input-type.md | 16 + legacy/doc/models/data-collection-options.md | 29 + legacy/doc/models/date-range.md | 26 + legacy/doc/models/day-of-week.md | 21 + ...ng-custom-attribute-definition-response.md | 24 + ...elete-booking-custom-attribute-response.md | 24 + .../doc/models/delete-break-type-response.md | 31 + .../models/delete-catalog-object-response.md | 35 + .../models/delete-customer-card-response.md | 37 + ...er-custom-attribute-definition-response.md | 36 + ...lete-customer-custom-attribute-response.md | 43 + .../models/delete-customer-group-response.md | 43 + legacy/doc/models/delete-customer-request.md | 24 + legacy/doc/models/delete-customer-response.md | 31 + .../delete-dispute-evidence-response.md | 42 + .../delete-invoice-attachment-response.md | 36 + legacy/doc/models/delete-invoice-request.md | 23 + legacy/doc/models/delete-invoice-response.md | 36 + ...on-custom-attribute-definition-response.md | 42 + ...lete-location-custom-attribute-response.md | 37 + .../models/delete-loyalty-reward-response.md | 42 + ...nt-custom-attribute-definition-response.md | 36 + ...lete-merchant-custom-attribute-response.md | 37 + ...er-custom-attribute-definition-response.md | 30 + .../delete-order-custom-attribute-response.md | 30 + .../models/delete-payment-link-response.md | 32 + legacy/doc/models/delete-shift-response.md | 31 + legacy/doc/models/delete-snippet-response.md | 42 + .../delete-subscription-action-response.md | 62 ++ .../delete-webhook-subscription-response.md | 31 + ...ed-create-dispute-evidence-file-request.md | 27 + ...d-create-dispute-evidence-file-response.md | 43 + ...ed-create-dispute-evidence-text-request.md | 27 + ...d-create-dispute-evidence-text-response.md | 43 + ...destination-details-card-refund-details.md | 31 + ...destination-details-cash-refund-details.md | 31 + ...ination-details-external-refund-details.md | 27 + legacy/doc/models/destination-details.md | 50 + legacy/doc/models/destination-type.md | 18 + legacy/doc/models/destination.md | 25 + .../models/device-attributes-device-type.md | 15 + legacy/doc/models/device-attributes.md | 34 + legacy/doc/models/device-checkout-options.md | 37 + legacy/doc/models/device-code-status.md | 18 + legacy/doc/models/device-code.md | 36 + ...e-component-details-application-details.md | 27 + ...evice-component-details-battery-details.md | 23 + ...e-component-details-card-reader-details.md | 21 + ...vice-component-details-ethernet-details.md | 23 + ...device-component-details-external-power.md | 18 + .../device-component-details-measurement.md | 23 + ...onent-details-network-interface-details.md | 21 + .../device-component-details-wi-fi-details.md | 31 + legacy/doc/models/device-details.md | 27 + legacy/doc/models/device-metadata.md | 36 + legacy/doc/models/device-status-category.md | 15 + legacy/doc/models/device-status.md | 21 + legacy/doc/models/device.md | 125 +++ legacy/doc/models/digital-wallet-details.md | 31 + legacy/doc/models/disable-card-response.md | 66 ++ legacy/doc/models/disable-events-response.md | 40 + .../dismiss-terminal-action-response.md | 63 ++ .../dismiss-terminal-checkout-response.md | 76 ++ .../dismiss-terminal-refund-response.md | 92 ++ legacy/doc/models/dispute-evidence-file.md | 25 + legacy/doc/models/dispute-evidence-type.md | 29 + legacy/doc/models/dispute-evidence.md | 34 + legacy/doc/models/dispute-reason.md | 24 + legacy/doc/models/dispute-state.md | 22 + legacy/doc/models/dispute.md | 45 + legacy/doc/models/disputed-payment.md | 23 + legacy/doc/models/ecom-visibility.md | 18 + legacy/doc/models/employee-status.md | 18 + legacy/doc/models/employee-wage.md | 32 + legacy/doc/models/employee.md | 38 + legacy/doc/models/enable-events-response.md | 34 + legacy/doc/models/error-category.md | 23 + legacy/doc/models/error-code.md | 165 +++ legacy/doc/models/error.md | 31 + legacy/doc/models/event-data.md | 30 + legacy/doc/models/event-metadata.md | 25 + legacy/doc/models/event-type-metadata.md | 27 + legacy/doc/models/event.md | 30 + legacy/doc/models/exclude-strategy.md | 17 + legacy/doc/models/external-payment-details.md | 34 + legacy/doc/models/filter-value.md | 42 + legacy/doc/models/float-number-range.md | 25 + ...fillment-delivery-details-schedule-type.md | 16 + .../models/fulfillment-delivery-details.md | 61 ++ .../models/fulfillment-fulfillment-entry.md | 34 + ...lment-fulfillment-line-item-application.md | 17 + ...-pickup-details-curbside-pickup-details.md | 25 + ...ulfillment-pickup-details-schedule-type.md | 16 + .../doc/models/fulfillment-pickup-details.md | 56 + legacy/doc/models/fulfillment-recipient.md | 37 + .../models/fulfillment-shipment-details.md | 53 + legacy/doc/models/fulfillment-state.md | 20 + legacy/doc/models/fulfillment-type.md | 17 + legacy/doc/models/fulfillment.md | 48 + .../get-bank-account-by-v1-id-response.md | 62 ++ .../doc/models/get-bank-account-response.md | 50 + legacy/doc/models/get-break-type-response.md | 49 + legacy/doc/models/get-device-code-response.md | 41 + legacy/doc/models/get-device-response.md | 191 ++++ .../doc/models/get-employee-wage-response.md | 54 + legacy/doc/models/get-invoice-response.md | 106 ++ .../doc/models/get-payment-refund-response.md | 100 ++ legacy/doc/models/get-payment-response.md | 101 ++ legacy/doc/models/get-payout-response.md | 54 + legacy/doc/models/get-shift-response.md | 82 ++ .../models/get-team-member-wage-response.md | 44 + .../models/get-terminal-action-response.md | 51 + .../models/get-terminal-checkout-response.md | 66 ++ .../models/get-terminal-refund-response.md | 56 + .../doc/models/gift-card-activity-activate.md | 36 + ...t-card-activity-adjust-decrement-reason.md | 18 + .../gift-card-activity-adjust-decrement.md | 28 + ...t-card-activity-adjust-increment-reason.md | 17 + .../gift-card-activity-adjust-increment.md | 28 + .../models/gift-card-activity-block-reason.md | 15 + legacy/doc/models/gift-card-activity-block.md | 23 + ...gift-card-activity-clear-balance-reason.md | 17 + .../gift-card-activity-clear-balance.md | 23 + .../gift-card-activity-deactivate-reason.md | 17 + .../models/gift-card-activity-deactivate.md | 23 + .../gift-card-activity-import-reversal.md | 26 + .../doc/models/gift-card-activity-import.md | 28 + legacy/doc/models/gift-card-activity-load.md | 37 + .../gift-card-activity-redeem-status.md | 19 + .../doc/models/gift-card-activity-redeem.md | 32 + .../doc/models/gift-card-activity-refund.md | 32 + ...ift-card-activity-transfer-balance-from.md | 28 + .../gift-card-activity-transfer-balance-to.md | 28 + legacy/doc/models/gift-card-activity-type.md | 29 + .../gift-card-activity-unblock-reason.md | 15 + .../doc/models/gift-card-activity-unblock.md | 23 + ...-card-activity-unlinked-activity-refund.md | 30 + legacy/doc/models/gift-card-activity.md | 55 + legacy/doc/models/gift-card-gan-source.md | 17 + legacy/doc/models/gift-card-status.md | 18 + legacy/doc/models/gift-card-type.md | 16 + legacy/doc/models/gift-card.md | 38 + .../doc/models/inventory-adjustment-group.md | 27 + legacy/doc/models/inventory-adjustment.md | 46 + legacy/doc/models/inventory-alert-type.md | 16 + legacy/doc/models/inventory-change-type.md | 17 + legacy/doc/models/inventory-change.md | 64 ++ legacy/doc/models/inventory-count.md | 35 + legacy/doc/models/inventory-physical-count.md | 41 + legacy/doc/models/inventory-state.md | 30 + legacy/doc/models/inventory-transfer.md | 40 + .../invoice-accepted-payment-methods.md | 31 + legacy/doc/models/invoice-attachment.md | 33 + .../invoice-automatic-payment-source.md | 17 + .../models/invoice-custom-field-placement.md | 17 + legacy/doc/models/invoice-custom-field.md | 31 + legacy/doc/models/invoice-delivery-method.md | 17 + legacy/doc/models/invoice-filter.md | 32 + .../models/invoice-payment-reminder-status.md | 17 + legacy/doc/models/invoice-payment-reminder.md | 33 + legacy/doc/models/invoice-payment-request.md | 47 + legacy/doc/models/invoice-query.md | 36 + .../doc/models/invoice-recipient-tax-ids.md | 25 + legacy/doc/models/invoice-recipient.md | 45 + legacy/doc/models/invoice-request-method.md | 24 + legacy/doc/models/invoice-request-type.md | 18 + legacy/doc/models/invoice-sort-field.md | 15 + legacy/doc/models/invoice-sort.md | 25 + legacy/doc/models/invoice-status.md | 24 + legacy/doc/models/invoice.md | 63 ++ .../item-variation-location-overrides.md | 37 + legacy/doc/models/job-assignment-pay-type.md | 17 + legacy/doc/models/job-assignment.md | 40 + legacy/doc/models/job.md | 34 + .../link-customer-to-gift-card-request.md | 23 + .../link-customer-to-gift-card-response.md | 47 + .../doc/models/list-bank-accounts-request.md | 28 + .../doc/models/list-bank-accounts-response.md | 73 ++ ...ng-custom-attribute-definitions-request.md | 25 + ...g-custom-attribute-definitions-response.md | 56 + .../list-booking-custom-attributes-request.md | 27 + ...list-booking-custom-attributes-response.md | 81 ++ legacy/doc/models/list-bookings-request.md | 31 + legacy/doc/models/list-bookings-response.md | 52 + legacy/doc/models/list-break-types-request.md | 27 + .../doc/models/list-break-types-response.md | 63 ++ legacy/doc/models/list-cards-request.md | 32 + legacy/doc/models/list-cards-response.md | 64 ++ .../list-cash-drawer-shift-events-request.md | 25 + .../list-cash-drawer-shift-events-response.md | 99 ++ .../models/list-cash-drawer-shifts-request.md | 31 + .../list-cash-drawer-shifts-response.md | 59 ++ legacy/doc/models/list-catalog-request.md | 25 + legacy/doc/models/list-catalog-response.md | 119 +++ ...er-custom-attribute-definitions-request.md | 25 + ...r-custom-attribute-definitions-response.md | 69 ++ ...list-customer-custom-attributes-request.md | 27 + ...ist-customer-custom-attributes-response.md | 106 ++ .../models/list-customer-groups-request.md | 26 + .../models/list-customer-groups-response.md | 62 ++ .../models/list-customer-segments-request.md | 25 + .../models/list-customer-segments-response.md | 73 ++ legacy/doc/models/list-customers-request.md | 32 + legacy/doc/models/list-customers-response.md | 98 ++ .../doc/models/list-device-codes-request.md | 31 + .../doc/models/list-device-codes-response.md | 69 ++ legacy/doc/models/list-devices-request.md | 27 + legacy/doc/models/list-devices-response.md | 368 +++++++ .../models/list-dispute-evidence-request.md | 23 + .../models/list-dispute-evidence-response.md | 45 + legacy/doc/models/list-disputes-request.md | 31 + legacy/doc/models/list-disputes-response.md | 77 ++ .../doc/models/list-employee-wages-request.md | 27 + .../models/list-employee-wages-response.md | 72 ++ legacy/doc/models/list-employees-request.md | 27 + legacy/doc/models/list-employees-response.md | 52 + legacy/doc/models/list-event-types-request.md | 23 + .../doc/models/list-event-types-response.md | 52 + .../list-gift-card-activities-request.md | 35 + .../list-gift-card-activities-response.md | 76 ++ legacy/doc/models/list-gift-cards-request.md | 32 + legacy/doc/models/list-gift-cards-response.md | 72 ++ legacy/doc/models/list-invoices-request.md | 27 + legacy/doc/models/list-invoices-response.md | 196 ++++ legacy/doc/models/list-jobs-request.md | 23 + legacy/doc/models/list-jobs-response.md | 52 + .../list-location-booking-profiles-request.md | 23 + ...list-location-booking-profiles-response.md | 36 + ...on-custom-attribute-definitions-request.md | 27 + ...n-custom-attribute-definitions-response.md | 63 ++ ...list-location-custom-attributes-request.md | 29 + ...ist-location-custom-attributes-response.md | 81 ++ legacy/doc/models/list-locations-response.md | 99 ++ .../models/list-loyalty-programs-response.md | 110 ++ .../models/list-loyalty-promotions-request.md | 27 + .../list-loyalty-promotions-response.md | 124 +++ ...nt-custom-attribute-definitions-request.md | 27 + ...t-custom-attribute-definitions-response.md | 69 ++ ...list-merchant-custom-attributes-request.md | 29 + ...ist-merchant-custom-attributes-response.md | 56 + legacy/doc/models/list-merchants-request.md | 23 + legacy/doc/models/list-merchants-response.md | 45 + ...er-custom-attribute-definitions-request.md | 27 + ...r-custom-attribute-definitions-response.md | 80 ++ .../list-order-custom-attributes-request.md | 29 + .../list-order-custom-attributes-response.md | 79 ++ .../doc/models/list-payment-links-request.md | 23 + .../doc/models/list-payment-links-response.md | 102 ++ .../models/list-payment-refunds-request.md | 37 + .../models/list-payment-refunds-response.md | 97 ++ legacy/doc/models/list-payments-request.md | 44 + legacy/doc/models/list-payments-response.md | 105 ++ .../doc/models/list-payout-entries-request.md | 25 + .../models/list-payout-entries-response.md | 84 ++ legacy/doc/models/list-payouts-request.md | 33 + legacy/doc/models/list-payouts-response.md | 97 ++ legacy/doc/models/list-refunds-request.md | 32 + legacy/doc/models/list-refunds-response.md | 66 ++ legacy/doc/models/list-sites-response.md | 49 + .../list-subscription-events-request.md | 27 + .../list-subscription-events-response.md | 169 +++ ...st-team-member-booking-profiles-request.md | 27 + ...t-team-member-booking-profiles-response.md | 40 + .../models/list-team-member-wages-request.md | 27 + .../models/list-team-member-wages-response.md | 86 ++ .../doc/models/list-transactions-request.md | 32 + .../doc/models/list-transactions-response.md | 111 ++ .../list-webhook-event-types-request.md | 23 + .../list-webhook-event-types-response.md | 46 + .../list-webhook-subscriptions-request.md | 29 + .../list-webhook-subscriptions-response.md | 52 + .../models/list-workweek-configs-request.md | 25 + .../models/list-workweek-configs-response.md | 45 + legacy/doc/models/location-booking-profile.md | 27 + legacy/doc/models/location-capability.md | 17 + legacy/doc/models/location-status.md | 16 + legacy/doc/models/location-type.md | 16 + legacy/doc/models/location.md | 61 ++ ...loyalty-account-expiring-point-deadline.md | 25 + .../models/loyalty-account-mapping-type.md | 15 + legacy/doc/models/loyalty-account-mapping.md | 30 + legacy/doc/models/loyalty-account.md | 38 + .../models/loyalty-event-accumulate-points.md | 27 + ...yalty-event-accumulate-promotion-points.md | 29 + .../doc/models/loyalty-event-adjust-points.md | 27 + .../doc/models/loyalty-event-create-reward.md | 27 + .../models/loyalty-event-date-time-filter.md | 26 + .../doc/models/loyalty-event-delete-reward.md | 27 + .../doc/models/loyalty-event-expire-points.md | 25 + legacy/doc/models/loyalty-event-filter.md | 53 + .../models/loyalty-event-location-filter.md | 27 + .../loyalty-event-loyalty-account-filter.md | 23 + .../doc/models/loyalty-event-order-filter.md | 23 + legacy/doc/models/loyalty-event-other.md | 25 + legacy/doc/models/loyalty-event-query.md | 50 + .../doc/models/loyalty-event-redeem-reward.md | 27 + legacy/doc/models/loyalty-event-source.md | 16 + .../doc/models/loyalty-event-type-filter.md | 27 + legacy/doc/models/loyalty-event-type.md | 22 + legacy/doc/models/loyalty-event.md | 66 ++ ...alty-program-accrual-rule-category-data.md | 23 + ...rogram-accrual-rule-item-variation-data.md | 23 + ...loyalty-program-accrual-rule-spend-data.md | 37 + .../loyalty-program-accrual-rule-tax-mode.md | 17 + .../loyalty-program-accrual-rule-type.md | 18 + ...loyalty-program-accrual-rule-visit-data.md | 28 + .../models/loyalty-program-accrual-rule.md | 56 + .../loyalty-program-expiration-policy.md | 23 + ...loyalty-program-reward-definition-scope.md | 19 + .../loyalty-program-reward-definition-type.md | 18 + .../loyalty-program-reward-definition.md | 43 + .../doc/models/loyalty-program-reward-tier.md | 51 + legacy/doc/models/loyalty-program-status.md | 16 + .../doc/models/loyalty-program-terminology.md | 25 + legacy/doc/models/loyalty-program.md | 95 ++ .../loyalty-promotion-available-time-data.md | 32 + ...romotion-incentive-points-addition-data.md | 23 + ...motion-incentive-points-multiplier-data.md | 25 + .../loyalty-promotion-incentive-type.md | 17 + .../doc/models/loyalty-promotion-incentive.md | 34 + legacy/doc/models/loyalty-promotion-status.md | 18 + ...oyalty-promotion-trigger-limit-interval.md | 17 + .../models/loyalty-promotion-trigger-limit.md | 29 + legacy/doc/models/loyalty-promotion.md | 63 ++ legacy/doc/models/loyalty-reward-status.md | 17 + legacy/doc/models/loyalty-reward.md | 38 + legacy/doc/models/measurement-unit-area.md | 22 + legacy/doc/models/measurement-unit-custom.md | 25 + legacy/doc/models/measurement-unit-generic.md | 13 + legacy/doc/models/measurement-unit-length.md | 22 + legacy/doc/models/measurement-unit-time.md | 19 + .../doc/models/measurement-unit-unit-type.md | 20 + legacy/doc/models/measurement-unit-volume.md | 25 + legacy/doc/models/measurement-unit-weight.md | 20 + legacy/doc/models/measurement-unit.md | 39 + legacy/doc/models/merchant-status.md | 14 + legacy/doc/models/merchant.md | 35 + .../doc/models/modifier-location-overrides.md | 30 + legacy/doc/models/money.md | 30 + legacy/doc/models/obtain-token-request.md | 36 + legacy/doc/models/obtain-token-response.md | 36 + legacy/doc/models/offline-payment-details.md | 23 + legacy/doc/models/order-created-object.md | 27 + legacy/doc/models/order-created.md | 29 + legacy/doc/models/order-entry.md | 28 + ...fillment-delivery-details-schedule-type.md | 16 + .../order-fulfillment-delivery-details.md | 61 ++ .../order-fulfillment-fulfillment-entry.md | 35 + ...lment-fulfillment-line-item-application.md | 17 + ...-pickup-details-curbside-pickup-details.md | 25 + ...ulfillment-pickup-details-schedule-type.md | 16 + .../order-fulfillment-pickup-details.md | 56 + .../doc/models/order-fulfillment-recipient.md | 37 + .../order-fulfillment-shipment-details.md | 53 + legacy/doc/models/order-fulfillment-state.md | 20 + legacy/doc/models/order-fulfillment-type.md | 17 + .../order-fulfillment-updated-object.md | 27 + .../order-fulfillment-updated-update.md | 27 + .../doc/models/order-fulfillment-updated.md | 31 + legacy/doc/models/order-fulfillment.md | 68 ++ .../order-line-item-applied-discount.md | 35 + .../order-line-item-applied-service-charge.md | 28 + .../doc/models/order-line-item-applied-tax.md | 35 + .../models/order-line-item-discount-scope.md | 17 + .../models/order-line-item-discount-type.md | 19 + legacy/doc/models/order-line-item-discount.md | 43 + .../doc/models/order-line-item-item-type.md | 17 + legacy/doc/models/order-line-item-modifier.md | 34 + ...tem-pricing-blocklists-blocked-discount.md | 28 + ...ine-item-pricing-blocklists-blocked-tax.md | 28 + .../order-line-item-pricing-blocklists.md | 54 + .../doc/models/order-line-item-tax-scope.md | 17 + legacy/doc/models/order-line-item-tax-type.md | 17 + legacy/doc/models/order-line-item-tax.md | 40 + legacy/doc/models/order-line-item.md | 64 ++ legacy/doc/models/order-money-amounts.md | 46 + legacy/doc/models/order-pricing-options.md | 27 + legacy/doc/models/order-quantity-unit.md | 39 + legacy/doc/models/order-return-discount.md | 41 + .../models/order-return-line-item-modifier.md | 34 + legacy/doc/models/order-return-line-item.md | 62 ++ .../doc/models/order-return-service-charge.md | 41 + legacy/doc/models/order-return-tax.md | 39 + legacy/doc/models/order-return-tip.md | 32 + legacy/doc/models/order-return.md | 95 ++ legacy/doc/models/order-reward.md | 26 + .../doc/models/order-rounding-adjustment.md | 31 + .../order-service-charge-calculation-phase.md | 21 + .../doc/models/order-service-charge-scope.md | 18 + .../order-service-charge-treatment-type.md | 17 + .../doc/models/order-service-charge-type.md | 14 + legacy/doc/models/order-service-charge.md | 42 + legacy/doc/models/order-source.md | 23 + legacy/doc/models/order-state.md | 18 + legacy/doc/models/order-updated-object.md | 27 + legacy/doc/models/order-updated.md | 30 + legacy/doc/models/order.md | 88 ++ legacy/doc/models/pagination-cursor.md | 24 + .../doc/models/pause-subscription-request.md | 32 + .../doc/models/pause-subscription-response.md | 84 ++ legacy/doc/models/pay-order-request.md | 31 + legacy/doc/models/pay-order-response.md | 226 ++++ ...-balance-activity-app-fee-refund-detail.md | 25 + ...balance-activity-app-fee-revenue-detail.md | 23 + ...lance-activity-automatic-savings-detail.md | 23 + ...ivity-automatic-savings-reversed-detail.md | 23 + .../payment-balance-activity-charge-detail.md | 21 + ...ent-balance-activity-deposit-fee-detail.md | 21 + ...ce-activity-deposit-fee-reversed-detail.md | 21 + ...payment-balance-activity-dispute-detail.md | 23 + .../payment-balance-activity-fee-detail.md | 21 + ...balance-activity-free-processing-detail.md | 21 + ...balance-activity-hold-adjustment-detail.md | 21 + ...nt-balance-activity-open-dispute-detail.md | 23 + ...alance-activity-other-adjustment-detail.md | 21 + .../payment-balance-activity-other-detail.md | 21 + .../payment-balance-activity-refund-detail.md | 23 + ...ance-activity-release-adjustment-detail.md | 21 + ...nt-balance-activity-reserve-hold-detail.md | 21 + ...balance-activity-reserve-release-detail.md | 21 + ...-activity-square-capital-payment-detail.md | 21 + ...-square-capital-reversed-payment-detail.md | 21 + ...activity-square-payroll-transfer-detail.md | 21 + ...square-payroll-transfer-reversed-detail.md | 21 + ...ment-balance-activity-tax-on-fee-detail.md | 23 + ...balance-activity-third-party-fee-detail.md | 21 + ...-activity-third-party-fee-refund-detail.md | 23 + .../models/payment-link-related-resources.md | 223 ++++ legacy/doc/models/payment-link.md | 59 ++ .../models/payment-options-delay-action.md | 17 + legacy/doc/models/payment-options.md | 27 + legacy/doc/models/payment-refund.md | 75 ++ legacy/doc/models/payment-sort-field.md | 15 + legacy/doc/models/payment.md | 76 ++ legacy/doc/models/payout-entry.md | 70 ++ legacy/doc/models/payout-fee-type.md | 16 + legacy/doc/models/payout-fee.md | 30 + legacy/doc/models/payout-status.md | 17 + legacy/doc/models/payout-type.md | 19 + legacy/doc/models/payout.md | 47 + legacy/doc/models/phase-input.md | 25 + legacy/doc/models/phase.md | 29 + legacy/doc/models/pre-populated-data.md | 35 + legacy/doc/models/processing-fee.md | 30 + legacy/doc/models/product-type.md | 13 + legacy/doc/models/product.md | 24 + legacy/doc/models/publish-invoice-request.md | 25 + legacy/doc/models/publish-invoice-response.md | 107 ++ legacy/doc/models/qr-code-options.md | 27 + legacy/doc/models/quantity-ratio.md | 25 + legacy/doc/models/quick-pay.md | 32 + legacy/doc/models/range.md | 25 + legacy/doc/models/receipt-options.md | 27 + .../models/redeem-loyalty-reward-request.md | 25 + .../models/redeem-loyalty-reward-response.md | 70 ++ legacy/doc/models/refund-payment-request.md | 48 + legacy/doc/models/refund-payment-response.md | 89 ++ legacy/doc/models/refund-status.md | 18 + legacy/doc/models/refund.md | 75 ++ legacy/doc/models/register-domain-request.md | 24 + .../models/register-domain-response-status.md | 16 + legacy/doc/models/register-domain-response.md | 47 + .../remove-group-from-customer-response.md | 38 + .../doc/models/resume-subscription-request.md | 26 + .../models/resume-subscription-response.md | 84 ++ ...ing-custom-attribute-definition-request.md | 23 + ...ng-custom-attribute-definition-response.md | 38 + ...trieve-booking-custom-attribute-request.md | 25 + ...rieve-booking-custom-attribute-response.md | 63 ++ .../doc/models/retrieve-booking-response.md | 42 + ...rieve-business-booking-profile-response.md | 45 + legacy/doc/models/retrieve-card-response.md | 66 ++ .../retrieve-cash-drawer-shift-request.md | 21 + .../retrieve-cash-drawer-shift-response.md | 77 ++ .../models/retrieve-catalog-object-request.md | 25 + .../retrieve-catalog-object-response.md | 171 +++ ...mer-custom-attribute-definition-request.md | 23 + ...er-custom-attribute-definition-response.md | 51 + ...rieve-customer-custom-attribute-request.md | 25 + ...ieve-customer-custom-attribute-response.md | 51 + .../retrieve-customer-group-response.md | 40 + .../doc/models/retrieve-customer-response.md | 85 ++ .../retrieve-customer-segment-response.md | 45 + .../retrieve-dispute-evidence-response.md | 43 + .../doc/models/retrieve-dispute-response.md | 52 + .../doc/models/retrieve-employee-response.md | 42 + .../retrieve-gift-card-from-gan-request.md | 23 + .../retrieve-gift-card-from-gan-response.md | 44 + .../retrieve-gift-card-from-nonce-request.md | 23 + .../retrieve-gift-card-from-nonce-response.md | 50 + .../doc/models/retrieve-gift-card-response.md | 50 + .../retrieve-inventory-adjustment-response.md | 44 + .../retrieve-inventory-changes-request.md | 23 + .../retrieve-inventory-changes-response.md | 79 ++ .../retrieve-inventory-count-request.md | 23 + .../retrieve-inventory-count-response.md | 34 + ...rieve-inventory-physical-count-response.md | 39 + .../retrieve-inventory-transfer-response.md | 40 + legacy/doc/models/retrieve-job-response.md | 46 + ...rieve-location-booking-profile-response.md | 28 + ...ion-custom-attribute-definition-request.md | 23 + ...on-custom-attribute-definition-response.md | 57 + ...rieve-location-custom-attribute-request.md | 25 + ...ieve-location-custom-attribute-response.md | 51 + .../doc/models/retrieve-location-response.md | 58 ++ .../retrieve-location-settings-response.md | 93 ++ .../retrieve-loyalty-account-response.md | 52 + .../retrieve-loyalty-program-response.md | 96 ++ .../retrieve-loyalty-promotion-response.md | 75 ++ .../retrieve-loyalty-reward-response.md | 48 + ...ant-custom-attribute-definition-request.md | 23 + ...nt-custom-attribute-definition-response.md | 45 + ...rieve-merchant-custom-attribute-request.md | 25 + ...ieve-merchant-custom-attribute-response.md | 57 + .../doc/models/retrieve-merchant-response.md | 47 + .../retrieve-merchant-settings-response.md | 76 ++ ...der-custom-attribute-definition-request.md | 23 + ...er-custom-attribute-definition-response.md | 44 + ...retrieve-order-custom-attribute-request.md | 25 + ...etrieve-order-custom-attribute-response.md | 56 + legacy/doc/models/retrieve-order-response.md | 231 +++++ .../models/retrieve-payment-link-response.md | 69 ++ .../doc/models/retrieve-snippet-response.md | 38 + .../models/retrieve-subscription-request.md | 24 + .../models/retrieve-subscription-response.md | 62 ++ ...ve-team-member-booking-profile-response.md | 29 + .../models/retrieve-team-member-response.md | 82 ++ .../models/retrieve-token-status-response.md | 48 + .../models/retrieve-transaction-response.md | 190 ++++ legacy/doc/models/retrieve-vendor-response.md | 44 + .../models/retrieve-wage-setting-response.md | 66 ++ .../retrieve-webhook-subscription-response.md | 49 + legacy/doc/models/revoke-token-request.md | 27 + legacy/doc/models/revoke-token-response.md | 30 + .../doc/models/risk-evaluation-risk-level.md | 16 + legacy/doc/models/risk-evaluation.md | 30 + legacy/doc/models/save-card-options.md | 27 + .../doc/models/search-availability-filter.md | 71 ++ .../doc/models/search-availability-query.md | 89 ++ .../doc/models/search-availability-request.md | 89 ++ .../models/search-availability-response.md | 276 +++++ ...earch-catalog-items-request-stock-level.md | 16 + .../models/search-catalog-items-request.md | 69 ++ .../models/search-catalog-items-response.md | 89 ++ .../models/search-catalog-objects-request.md | 41 + .../models/search-catalog-objects-response.md | 231 +++++ legacy/doc/models/search-customers-request.md | 64 ++ .../doc/models/search-customers-response.md | 131 +++ legacy/doc/models/search-events-filter.md | 43 + legacy/doc/models/search-events-query.md | 44 + legacy/doc/models/search-events-request.md | 49 + legacy/doc/models/search-events-response.md | 85 ++ legacy/doc/models/search-events-sort-field.md | 15 + legacy/doc/models/search-events-sort.md | 25 + legacy/doc/models/search-invoices-request.md | 41 + legacy/doc/models/search-invoices-response.md | 191 ++++ ...-accounts-request-loyalty-account-query.md | 45 + .../models/search-loyalty-accounts-request.md | 40 + .../search-loyalty-accounts-response.md | 56 + .../models/search-loyalty-events-request.md | 56 + .../models/search-loyalty-events-response.md | 146 +++ ...ty-rewards-request-loyalty-reward-query.md | 25 + .../models/search-loyalty-rewards-request.md | 30 + .../models/search-loyalty-rewards-response.md | 89 ++ .../models/search-orders-customer-filter.md | 29 + .../models/search-orders-date-time-filter.md | 49 + legacy/doc/models/search-orders-filter.md | 67 ++ .../search-orders-fulfillment-filter.md | 30 + legacy/doc/models/search-orders-query.md | 69 ++ legacy/doc/models/search-orders-request.md | 78 ++ legacy/doc/models/search-orders-response.md | 225 ++++ legacy/doc/models/search-orders-sort-field.md | 17 + legacy/doc/models/search-orders-sort.md | 26 + .../doc/models/search-orders-source-filter.md | 27 + .../doc/models/search-orders-state-filter.md | 27 + legacy/doc/models/search-shifts-request.md | 57 + legacy/doc/models/search-shifts-response.md | 120 +++ .../doc/models/search-subscriptions-filter.md | 39 + .../doc/models/search-subscriptions-query.md | 34 + .../models/search-subscriptions-request.md | 44 + .../models/search-subscriptions-response.md | 100 ++ .../doc/models/search-team-members-filter.md | 37 + .../doc/models/search-team-members-query.md | 29 + .../doc/models/search-team-members-request.md | 35 + .../models/search-team-members-response.md | 284 +++++ .../models/search-terminal-actions-request.md | 38 + .../search-terminal-actions-response.md | 66 ++ .../search-terminal-checkouts-request.md | 37 + .../search-terminal-checkouts-response.md | 123 +++ .../models/search-terminal-refunds-request.md | 37 + .../search-terminal-refunds-response.md | 72 ++ .../models/search-vendors-request-filter.md | 33 + .../search-vendors-request-sort-field.md | 16 + .../doc/models/search-vendors-request-sort.md | 25 + legacy/doc/models/search-vendors-request.md | 55 + legacy/doc/models/search-vendors-response.md | 61 ++ legacy/doc/models/segment-filter.md | 40 + legacy/doc/models/select-option.md | 23 + legacy/doc/models/select-options.md | 35 + legacy/doc/models/shift-filter-status.md | 16 + legacy/doc/models/shift-filter.md | 48 + legacy/doc/models/shift-query.md | 44 + legacy/doc/models/shift-sort-field.md | 18 + legacy/doc/models/shift-sort.md | 25 + legacy/doc/models/shift-status.md | 16 + legacy/doc/models/shift-wage.md | 32 + legacy/doc/models/shift-workday-matcher.md | 17 + legacy/doc/models/shift-workday.md | 31 + legacy/doc/models/shift.md | 52 + legacy/doc/models/shipping-fee.md | 26 + legacy/doc/models/signature-image.md | 23 + legacy/doc/models/signature-options.md | 38 + legacy/doc/models/site.md | 32 + legacy/doc/models/snippet-response.md | 42 + legacy/doc/models/snippet.md | 31 + legacy/doc/models/sort-order.md | 16 + legacy/doc/models/source-application.md | 27 + legacy/doc/models/square-account-details.md | 38 + .../models/standard-unit-description-group.md | 68 ++ .../doc/models/standard-unit-description.md | 36 + legacy/doc/models/submit-evidence-response.md | 64 ++ legacy/doc/models/subscription-action-type.md | 19 + legacy/doc/models/subscription-action.md | 45 + legacy/doc/models/subscription-cadence.md | 27 + .../models/subscription-event-info-code.md | 20 + legacy/doc/models/subscription-event-info.md | 25 + ...scription-event-subscription-event-type.md | 21 + legacy/doc/models/subscription-event.md | 51 + legacy/doc/models/subscription-phase.md | 46 + .../doc/models/subscription-pricing-type.md | 16 + legacy/doc/models/subscription-pricing.md | 33 + legacy/doc/models/subscription-source.md | 23 + legacy/doc/models/subscription-status.md | 19 + legacy/doc/models/subscription-test-result.md | 32 + legacy/doc/models/subscription.md | 48 + legacy/doc/models/swap-plan-request.md | 31 + legacy/doc/models/swap-plan-response.md | 88 ++ legacy/doc/models/tax-calculation-phase.md | 16 + legacy/doc/models/tax-ids.md | 31 + legacy/doc/models/tax-inclusion-type.md | 16 + ...mber-assigned-locations-assignment-type.md | 16 + .../models/team-member-assigned-locations.md | 28 + .../doc/models/team-member-booking-profile.md | 31 + .../models/team-member-invitation-status.md | 17 + legacy/doc/models/team-member-status.md | 16 + legacy/doc/models/team-member-wage.md | 36 + legacy/doc/models/team-member.md | 38 + .../tender-bank-account-details-status.md | 17 + .../doc/models/tender-bank-account-details.md | 26 + .../tender-buy-now-pay-later-details-brand.md | 14 + ...tender-buy-now-pay-later-details-status.md | 16 + .../tender-buy-now-pay-later-details.md | 25 + .../tender-card-details-entry-method.md | 19 + .../doc/models/tender-card-details-status.md | 18 + legacy/doc/models/tender-card-details.md | 33 + legacy/doc/models/tender-cash-details.md | 31 + .../tender-square-account-details-status.md | 16 + .../models/tender-square-account-details.md | 23 + legacy/doc/models/tender-type.md | 24 + legacy/doc/models/tender.md | 44 + .../doc/models/terminal-action-action-type.md | 22 + .../models/terminal-action-query-filter.md | 30 + .../doc/models/terminal-action-query-sort.md | 21 + legacy/doc/models/terminal-action-query.md | 42 + legacy/doc/models/terminal-action.md | 46 + .../models/terminal-checkout-query-filter.md | 28 + .../models/terminal-checkout-query-sort.md | 21 + legacy/doc/models/terminal-checkout-query.md | 32 + legacy/doc/models/terminal-checkout.md | 71 ++ .../models/terminal-refund-query-filter.md | 28 + .../doc/models/terminal-refund-query-sort.md | 21 + legacy/doc/models/terminal-refund-query.md | 32 + legacy/doc/models/terminal-refund.md | 47 + .../test-webhook-subscription-request.md | 23 + .../test-webhook-subscription-response.md | 48 + legacy/doc/models/time-range.md | 29 + legacy/doc/models/tip-settings.md | 33 + legacy/doc/models/transaction-product.md | 22 + legacy/doc/models/transaction-type.md | 16 + legacy/doc/models/transaction.md | 177 ++++ .../unlink-customer-from-gift-card-request.md | 23 + ...unlink-customer-from-gift-card-response.md | 56 + ...ing-custom-attribute-definition-request.md | 34 + ...ng-custom-attribute-definition-response.md | 38 + legacy/doc/models/update-booking-request.md | 29 + legacy/doc/models/update-booking-response.md | 50 + .../doc/models/update-break-type-request.md | 32 + .../doc/models/update-break-type-response.md | 43 + .../models/update-catalog-image-request.md | 29 + .../models/update-catalog-image-response.md | 77 ++ ...mer-custom-attribute-definition-request.md | 34 + ...er-custom-attribute-definition-response.md | 57 + .../models/update-customer-group-request.md | 29 + .../models/update-customer-group-response.md | 52 + legacy/doc/models/update-customer-request.md | 42 + legacy/doc/models/update-customer-response.md | 73 ++ legacy/doc/models/update-invoice-request.md | 56 + legacy/doc/models/update-invoice-response.md | 108 ++ .../update-item-modifier-lists-request.md | 33 + .../update-item-modifier-lists-response.md | 42 + .../doc/models/update-item-taxes-request.md | 32 + .../doc/models/update-item-taxes-response.md | 42 + legacy/doc/models/update-job-request.md | 29 + legacy/doc/models/update-job-response.md | 52 + ...ion-custom-attribute-definition-request.md | 34 + ...on-custom-attribute-definition-response.md | 57 + legacy/doc/models/update-location-request.md | 57 + legacy/doc/models/update-location-response.md | 87 ++ .../update-location-settings-request.md | 68 ++ .../update-location-settings-response.md | 104 ++ ...ant-custom-attribute-definition-request.md | 34 + ...nt-custom-attribute-definition-response.md | 45 + .../update-merchant-settings-request.md | 57 + .../update-merchant-settings-response.md | 76 ++ ...der-custom-attribute-definition-request.md | 35 + ...er-custom-attribute-definition-response.md | 56 + legacy/doc/models/update-order-request.md | 64 ++ legacy/doc/models/update-order-response.md | 187 ++++ .../doc/models/update-payment-link-request.md | 52 + .../models/update-payment-link-response.md | 78 ++ legacy/doc/models/update-payment-request.md | 39 + legacy/doc/models/update-payment-response.md | 111 ++ legacy/doc/models/update-shift-request.md | 56 + legacy/doc/models/update-shift-response.md | 82 ++ .../doc/models/update-subscription-request.md | 32 + .../models/update-subscription-response.md | 58 ++ .../doc/models/update-team-member-request.md | 61 ++ .../doc/models/update-team-member-response.md | 82 ++ legacy/doc/models/update-vendor-request.md | 39 + legacy/doc/models/update-vendor-response.md | 71 ++ .../doc/models/update-wage-setting-request.md | 58 ++ .../models/update-wage-setting-response.md | 75 ++ .../update-webhook-subscription-request.md | 32 + .../update-webhook-subscription-response.md | 48 + ...hook-subscription-signature-key-request.md | 23 + ...ook-subscription-signature-key-response.md | 48 + .../models/update-workweek-config-request.md | 30 + .../models/update-workweek-config-response.md | 53 + ...upsert-booking-custom-attribute-request.md | 43 + ...psert-booking-custom-attribute-response.md | 63 ++ .../models/upsert-catalog-object-request.md | 80 ++ .../models/upsert-catalog-object-response.md | 139 +++ ...psert-customer-custom-attribute-request.md | 43 + ...sert-customer-custom-attribute-response.md | 51 + ...psert-location-custom-attribute-request.md | 43 + ...sert-location-custom-attribute-response.md | 57 + ...psert-merchant-custom-attribute-request.md | 43 + ...sert-merchant-custom-attribute-response.md | 51 + .../upsert-order-custom-attribute-request.md | 43 + .../upsert-order-custom-attribute-response.md | 62 ++ legacy/doc/models/upsert-snippet-request.md | 29 + legacy/doc/models/upsert-snippet-response.md | 44 + legacy/doc/models/v1-device.md | 23 + legacy/doc/models/v1-list-orders-request.md | 25 + legacy/doc/models/v1-list-orders-response.md | 50 + legacy/doc/models/v1-money.md | 23 + .../models/v1-order-history-entry-action.md | 19 + legacy/doc/models/v1-order-history-entry.md | 25 + legacy/doc/models/v1-order-state.md | 18 + legacy/doc/models/v1-order.md | 64 ++ legacy/doc/models/v1-phone-number.md | 25 + legacy/doc/models/v1-tender-card-brand.md | 23 + legacy/doc/models/v1-tender-entry-method.md | 19 + legacy/doc/models/v1-tender-type.md | 20 + legacy/doc/models/v1-tender.md | 63 ++ .../models/v1-update-order-request-action.md | 15 + legacy/doc/models/v1-update-order-request.md | 31 + legacy/doc/models/vendor-contact.md | 33 + legacy/doc/models/vendor-status.md | 17 + legacy/doc/models/vendor.md | 42 + legacy/doc/models/visibility-filter.md | 17 + .../doc/models/void-transaction-response.md | 43 + legacy/doc/models/wage-setting.md | 76 ++ legacy/doc/models/webhook-subscription.md | 38 + legacy/doc/models/weekday.md | 21 + legacy/doc/models/workweek-config.md | 34 + legacy/exports/index.d.mts | 1 + legacy/exports/index.d.ts | 1 + legacy/exports/index.js | 1 + legacy/exports/index.mjs | 1 + 1178 files changed, 69607 insertions(+) create mode 100644 legacy/CHANGELOG.md create mode 100644 legacy/README.md create mode 100644 legacy/doc/api-error.md create mode 100644 legacy/doc/api-response.md create mode 100644 legacy/doc/api/apple-pay.md create mode 100644 legacy/doc/api/bank-accounts.md create mode 100644 legacy/doc/api/booking-custom-attributes.md create mode 100644 legacy/doc/api/bookings.md create mode 100644 legacy/doc/api/cards.md create mode 100644 legacy/doc/api/cash-drawers.md create mode 100644 legacy/doc/api/catalog.md create mode 100644 legacy/doc/api/checkout.md create mode 100644 legacy/doc/api/customer-custom-attributes.md create mode 100644 legacy/doc/api/customer-groups.md create mode 100644 legacy/doc/api/customer-segments.md create mode 100644 legacy/doc/api/customers.md create mode 100644 legacy/doc/api/devices.md create mode 100644 legacy/doc/api/disputes.md create mode 100644 legacy/doc/api/employees.md create mode 100644 legacy/doc/api/events.md create mode 100644 legacy/doc/api/gift-card-activities.md create mode 100644 legacy/doc/api/gift-cards.md create mode 100644 legacy/doc/api/inventory.md create mode 100644 legacy/doc/api/invoices.md create mode 100644 legacy/doc/api/labor.md create mode 100644 legacy/doc/api/location-custom-attributes.md create mode 100644 legacy/doc/api/locations.md create mode 100644 legacy/doc/api/loyalty.md create mode 100644 legacy/doc/api/merchant-custom-attributes.md create mode 100644 legacy/doc/api/merchants.md create mode 100644 legacy/doc/api/mobile-authorization.md create mode 100644 legacy/doc/api/o-auth.md create mode 100644 legacy/doc/api/order-custom-attributes.md create mode 100644 legacy/doc/api/orders.md create mode 100644 legacy/doc/api/payments.md create mode 100644 legacy/doc/api/payouts.md create mode 100644 legacy/doc/api/refunds.md create mode 100644 legacy/doc/api/sites.md create mode 100644 legacy/doc/api/snippets.md create mode 100644 legacy/doc/api/subscriptions.md create mode 100644 legacy/doc/api/team.md create mode 100644 legacy/doc/api/terminal.md create mode 100644 legacy/doc/api/transactions.md create mode 100644 legacy/doc/api/v1-transactions.md create mode 100644 legacy/doc/api/vendors.md create mode 100644 legacy/doc/api/webhook-subscriptions.md create mode 100644 legacy/doc/auth/oauth-2-bearer-token.md create mode 100644 legacy/doc/client.md create mode 100644 legacy/doc/models/accept-dispute-response.md create mode 100644 legacy/doc/models/accepted-payment-methods.md create mode 100644 legacy/doc/models/accumulate-loyalty-points-request.md create mode 100644 legacy/doc/models/accumulate-loyalty-points-response.md create mode 100644 legacy/doc/models/ach-details.md create mode 100644 legacy/doc/models/action-cancel-reason.md create mode 100644 legacy/doc/models/activity-type.md create mode 100644 legacy/doc/models/add-group-to-customer-response.md create mode 100644 legacy/doc/models/additional-recipient.md create mode 100644 legacy/doc/models/address.md create mode 100644 legacy/doc/models/adjust-loyalty-points-request.md create mode 100644 legacy/doc/models/adjust-loyalty-points-response.md create mode 100644 legacy/doc/models/afterpay-details.md create mode 100644 legacy/doc/models/application-details-external-square-product.md create mode 100644 legacy/doc/models/application-details.md create mode 100644 legacy/doc/models/application-type.md create mode 100644 legacy/doc/models/appointment-segment.md create mode 100644 legacy/doc/models/archived-state.md create mode 100644 legacy/doc/models/availability.md create mode 100644 legacy/doc/models/bank-account-payment-details.md create mode 100644 legacy/doc/models/bank-account-status.md create mode 100644 legacy/doc/models/bank-account-type.md create mode 100644 legacy/doc/models/bank-account.md create mode 100644 legacy/doc/models/batch-change-inventory-request.md create mode 100644 legacy/doc/models/batch-change-inventory-response.md create mode 100644 legacy/doc/models/batch-delete-catalog-objects-request.md create mode 100644 legacy/doc/models/batch-delete-catalog-objects-response.md create mode 100644 legacy/doc/models/batch-retrieve-catalog-objects-request.md create mode 100644 legacy/doc/models/batch-retrieve-catalog-objects-response.md create mode 100644 legacy/doc/models/batch-retrieve-inventory-changes-request.md create mode 100644 legacy/doc/models/batch-retrieve-inventory-changes-response.md create mode 100644 legacy/doc/models/batch-retrieve-inventory-counts-request.md create mode 100644 legacy/doc/models/batch-retrieve-inventory-counts-response.md create mode 100644 legacy/doc/models/batch-retrieve-orders-request.md create mode 100644 legacy/doc/models/batch-retrieve-orders-response.md create mode 100644 legacy/doc/models/batch-upsert-catalog-objects-request.md create mode 100644 legacy/doc/models/batch-upsert-catalog-objects-response.md create mode 100644 legacy/doc/models/booking-booking-source.md create mode 100644 legacy/doc/models/booking-creator-details-creator-type.md create mode 100644 legacy/doc/models/booking-creator-details.md create mode 100644 legacy/doc/models/booking-custom-attribute-delete-request.md create mode 100644 legacy/doc/models/booking-custom-attribute-delete-response.md create mode 100644 legacy/doc/models/booking-custom-attribute-upsert-request.md create mode 100644 legacy/doc/models/booking-custom-attribute-upsert-response.md create mode 100644 legacy/doc/models/booking-status.md create mode 100644 legacy/doc/models/booking.md create mode 100644 legacy/doc/models/break-type.md create mode 100644 legacy/doc/models/break.md create mode 100644 legacy/doc/models/bulk-create-customer-data.md create mode 100644 legacy/doc/models/bulk-create-customers-request.md create mode 100644 legacy/doc/models/bulk-create-customers-response.md create mode 100644 legacy/doc/models/bulk-create-team-members-request.md create mode 100644 legacy/doc/models/bulk-create-team-members-response.md create mode 100644 legacy/doc/models/bulk-create-vendors-request.md create mode 100644 legacy/doc/models/bulk-create-vendors-response.md create mode 100644 legacy/doc/models/bulk-delete-booking-custom-attributes-request.md create mode 100644 legacy/doc/models/bulk-delete-booking-custom-attributes-response.md create mode 100644 legacy/doc/models/bulk-delete-customers-request.md create mode 100644 legacy/doc/models/bulk-delete-customers-response.md create mode 100644 legacy/doc/models/bulk-delete-location-custom-attributes-request-location-custom-attribute-delete-request.md create mode 100644 legacy/doc/models/bulk-delete-location-custom-attributes-request.md create mode 100644 legacy/doc/models/bulk-delete-location-custom-attributes-response-location-custom-attribute-delete-response.md create mode 100644 legacy/doc/models/bulk-delete-location-custom-attributes-response.md create mode 100644 legacy/doc/models/bulk-delete-merchant-custom-attributes-request-merchant-custom-attribute-delete-request.md create mode 100644 legacy/doc/models/bulk-delete-merchant-custom-attributes-request.md create mode 100644 legacy/doc/models/bulk-delete-merchant-custom-attributes-response-merchant-custom-attribute-delete-response.md create mode 100644 legacy/doc/models/bulk-delete-merchant-custom-attributes-response.md create mode 100644 legacy/doc/models/bulk-delete-order-custom-attributes-request-delete-custom-attribute.md create mode 100644 legacy/doc/models/bulk-delete-order-custom-attributes-request.md create mode 100644 legacy/doc/models/bulk-delete-order-custom-attributes-response.md create mode 100644 legacy/doc/models/bulk-retrieve-bookings-request.md create mode 100644 legacy/doc/models/bulk-retrieve-bookings-response.md create mode 100644 legacy/doc/models/bulk-retrieve-customers-request.md create mode 100644 legacy/doc/models/bulk-retrieve-customers-response.md create mode 100644 legacy/doc/models/bulk-retrieve-team-member-booking-profiles-request.md create mode 100644 legacy/doc/models/bulk-retrieve-team-member-booking-profiles-response.md create mode 100644 legacy/doc/models/bulk-retrieve-vendors-request.md create mode 100644 legacy/doc/models/bulk-retrieve-vendors-response.md create mode 100644 legacy/doc/models/bulk-swap-plan-request.md create mode 100644 legacy/doc/models/bulk-swap-plan-response.md create mode 100644 legacy/doc/models/bulk-update-customer-data.md create mode 100644 legacy/doc/models/bulk-update-customers-request.md create mode 100644 legacy/doc/models/bulk-update-customers-response.md create mode 100644 legacy/doc/models/bulk-update-team-members-request.md create mode 100644 legacy/doc/models/bulk-update-team-members-response.md create mode 100644 legacy/doc/models/bulk-update-vendors-request.md create mode 100644 legacy/doc/models/bulk-update-vendors-response.md create mode 100644 legacy/doc/models/bulk-upsert-booking-custom-attributes-request.md create mode 100644 legacy/doc/models/bulk-upsert-booking-custom-attributes-response.md create mode 100644 legacy/doc/models/bulk-upsert-customer-custom-attributes-request-customer-custom-attribute-upsert-request.md create mode 100644 legacy/doc/models/bulk-upsert-customer-custom-attributes-request.md create mode 100644 legacy/doc/models/bulk-upsert-customer-custom-attributes-response-customer-custom-attribute-upsert-response.md create mode 100644 legacy/doc/models/bulk-upsert-customer-custom-attributes-response.md create mode 100644 legacy/doc/models/bulk-upsert-location-custom-attributes-request-location-custom-attribute-upsert-request.md create mode 100644 legacy/doc/models/bulk-upsert-location-custom-attributes-request.md create mode 100644 legacy/doc/models/bulk-upsert-location-custom-attributes-response-location-custom-attribute-upsert-response.md create mode 100644 legacy/doc/models/bulk-upsert-location-custom-attributes-response.md create mode 100644 legacy/doc/models/bulk-upsert-merchant-custom-attributes-request-merchant-custom-attribute-upsert-request.md create mode 100644 legacy/doc/models/bulk-upsert-merchant-custom-attributes-request.md create mode 100644 legacy/doc/models/bulk-upsert-merchant-custom-attributes-response-merchant-custom-attribute-upsert-response.md create mode 100644 legacy/doc/models/bulk-upsert-merchant-custom-attributes-response.md create mode 100644 legacy/doc/models/bulk-upsert-order-custom-attributes-request-upsert-custom-attribute.md create mode 100644 legacy/doc/models/bulk-upsert-order-custom-attributes-request.md create mode 100644 legacy/doc/models/bulk-upsert-order-custom-attributes-response.md create mode 100644 legacy/doc/models/business-appointment-settings-alignment-time.md create mode 100644 legacy/doc/models/business-appointment-settings-booking-location-type.md create mode 100644 legacy/doc/models/business-appointment-settings-cancellation-policy.md create mode 100644 legacy/doc/models/business-appointment-settings-max-appointments-per-day-limit-type.md create mode 100644 legacy/doc/models/business-appointment-settings.md create mode 100644 legacy/doc/models/business-booking-profile-booking-policy.md create mode 100644 legacy/doc/models/business-booking-profile-customer-timezone-choice.md create mode 100644 legacy/doc/models/business-booking-profile.md create mode 100644 legacy/doc/models/business-hours-period.md create mode 100644 legacy/doc/models/business-hours.md create mode 100644 legacy/doc/models/buy-now-pay-later-details.md create mode 100644 legacy/doc/models/calculate-loyalty-points-request.md create mode 100644 legacy/doc/models/calculate-loyalty-points-response.md create mode 100644 legacy/doc/models/calculate-order-request.md create mode 100644 legacy/doc/models/calculate-order-response.md create mode 100644 legacy/doc/models/cancel-booking-request.md create mode 100644 legacy/doc/models/cancel-booking-response.md create mode 100644 legacy/doc/models/cancel-invoice-request.md create mode 100644 legacy/doc/models/cancel-invoice-response.md create mode 100644 legacy/doc/models/cancel-loyalty-promotion-response.md create mode 100644 legacy/doc/models/cancel-payment-by-idempotency-key-request.md create mode 100644 legacy/doc/models/cancel-payment-by-idempotency-key-response.md create mode 100644 legacy/doc/models/cancel-payment-response.md create mode 100644 legacy/doc/models/cancel-subscription-response.md create mode 100644 legacy/doc/models/cancel-terminal-action-response.md create mode 100644 legacy/doc/models/cancel-terminal-checkout-response.md create mode 100644 legacy/doc/models/cancel-terminal-refund-response.md create mode 100644 legacy/doc/models/capture-transaction-response.md create mode 100644 legacy/doc/models/card-brand.md create mode 100644 legacy/doc/models/card-co-brand.md create mode 100644 legacy/doc/models/card-payment-details.md create mode 100644 legacy/doc/models/card-payment-timeline.md create mode 100644 legacy/doc/models/card-prepaid-type.md create mode 100644 legacy/doc/models/card-type.md create mode 100644 legacy/doc/models/card.md create mode 100644 legacy/doc/models/cash-app-details.md create mode 100644 legacy/doc/models/cash-drawer-device.md create mode 100644 legacy/doc/models/cash-drawer-event-type.md create mode 100644 legacy/doc/models/cash-drawer-shift-event.md create mode 100644 legacy/doc/models/cash-drawer-shift-state.md create mode 100644 legacy/doc/models/cash-drawer-shift-summary.md create mode 100644 legacy/doc/models/cash-drawer-shift.md create mode 100644 legacy/doc/models/cash-payment-details.md create mode 100644 legacy/doc/models/catalog-availability-period.md create mode 100644 legacy/doc/models/catalog-category-type.md create mode 100644 legacy/doc/models/catalog-category.md create mode 100644 legacy/doc/models/catalog-custom-attribute-definition-app-visibility.md create mode 100644 legacy/doc/models/catalog-custom-attribute-definition-number-config.md create mode 100644 legacy/doc/models/catalog-custom-attribute-definition-selection-config-custom-attribute-selection.md create mode 100644 legacy/doc/models/catalog-custom-attribute-definition-selection-config.md create mode 100644 legacy/doc/models/catalog-custom-attribute-definition-seller-visibility.md create mode 100644 legacy/doc/models/catalog-custom-attribute-definition-string-config.md create mode 100644 legacy/doc/models/catalog-custom-attribute-definition-type.md create mode 100644 legacy/doc/models/catalog-custom-attribute-definition.md create mode 100644 legacy/doc/models/catalog-custom-attribute-value.md create mode 100644 legacy/doc/models/catalog-discount-modify-tax-basis.md create mode 100644 legacy/doc/models/catalog-discount-type.md create mode 100644 legacy/doc/models/catalog-discount.md create mode 100644 legacy/doc/models/catalog-ecom-seo-data.md create mode 100644 legacy/doc/models/catalog-id-mapping.md create mode 100644 legacy/doc/models/catalog-image.md create mode 100644 legacy/doc/models/catalog-info-response-limits.md create mode 100644 legacy/doc/models/catalog-info-response.md create mode 100644 legacy/doc/models/catalog-item-food-and-beverage-details-dietary-preference-standard-dietary-preference.md create mode 100644 legacy/doc/models/catalog-item-food-and-beverage-details-dietary-preference-type.md create mode 100644 legacy/doc/models/catalog-item-food-and-beverage-details-dietary-preference.md create mode 100644 legacy/doc/models/catalog-item-food-and-beverage-details-ingredient-standard-ingredient.md create mode 100644 legacy/doc/models/catalog-item-food-and-beverage-details-ingredient.md create mode 100644 legacy/doc/models/catalog-item-food-and-beverage-details.md create mode 100644 legacy/doc/models/catalog-item-modifier-list-info.md create mode 100644 legacy/doc/models/catalog-item-option-for-item.md create mode 100644 legacy/doc/models/catalog-item-option-value-for-item-variation.md create mode 100644 legacy/doc/models/catalog-item-option-value.md create mode 100644 legacy/doc/models/catalog-item-option.md create mode 100644 legacy/doc/models/catalog-item-product-type.md create mode 100644 legacy/doc/models/catalog-item-variation.md create mode 100644 legacy/doc/models/catalog-item.md create mode 100644 legacy/doc/models/catalog-measurement-unit.md create mode 100644 legacy/doc/models/catalog-modifier-list-modifier-type.md create mode 100644 legacy/doc/models/catalog-modifier-list-selection-type.md create mode 100644 legacy/doc/models/catalog-modifier-list.md create mode 100644 legacy/doc/models/catalog-modifier-override.md create mode 100644 legacy/doc/models/catalog-modifier.md create mode 100644 legacy/doc/models/catalog-object-batch.md create mode 100644 legacy/doc/models/catalog-object-category.md create mode 100644 legacy/doc/models/catalog-object-reference.md create mode 100644 legacy/doc/models/catalog-object-type.md create mode 100644 legacy/doc/models/catalog-object.md create mode 100644 legacy/doc/models/catalog-pricing-rule.md create mode 100644 legacy/doc/models/catalog-pricing-type.md create mode 100644 legacy/doc/models/catalog-product-set.md create mode 100644 legacy/doc/models/catalog-query-exact.md create mode 100644 legacy/doc/models/catalog-query-item-variations-for-item-option-values.md create mode 100644 legacy/doc/models/catalog-query-items-for-item-options.md create mode 100644 legacy/doc/models/catalog-query-items-for-modifier-list.md create mode 100644 legacy/doc/models/catalog-query-items-for-tax.md create mode 100644 legacy/doc/models/catalog-query-prefix.md create mode 100644 legacy/doc/models/catalog-query-range.md create mode 100644 legacy/doc/models/catalog-query-set.md create mode 100644 legacy/doc/models/catalog-query-sorted-attribute.md create mode 100644 legacy/doc/models/catalog-query-text.md create mode 100644 legacy/doc/models/catalog-query.md create mode 100644 legacy/doc/models/catalog-quick-amount-type.md create mode 100644 legacy/doc/models/catalog-quick-amount.md create mode 100644 legacy/doc/models/catalog-quick-amounts-settings-option.md create mode 100644 legacy/doc/models/catalog-quick-amounts-settings.md create mode 100644 legacy/doc/models/catalog-stock-conversion.md create mode 100644 legacy/doc/models/catalog-subscription-plan-variation.md create mode 100644 legacy/doc/models/catalog-subscription-plan.md create mode 100644 legacy/doc/models/catalog-tax.md create mode 100644 legacy/doc/models/catalog-time-period.md create mode 100644 legacy/doc/models/catalog-v1-id.md create mode 100644 legacy/doc/models/category-path-to-root-node.md create mode 100644 legacy/doc/models/change-billing-anchor-date-request.md create mode 100644 legacy/doc/models/change-billing-anchor-date-response.md create mode 100644 legacy/doc/models/change-timing.md create mode 100644 legacy/doc/models/charge-request-additional-recipient.md create mode 100644 legacy/doc/models/charge-request.md create mode 100644 legacy/doc/models/charge-response.md create mode 100644 legacy/doc/models/checkout-location-settings-branding-button-shape.md create mode 100644 legacy/doc/models/checkout-location-settings-branding-header-type.md create mode 100644 legacy/doc/models/checkout-location-settings-branding.md create mode 100644 legacy/doc/models/checkout-location-settings-coupons.md create mode 100644 legacy/doc/models/checkout-location-settings-policy.md create mode 100644 legacy/doc/models/checkout-location-settings-tipping.md create mode 100644 legacy/doc/models/checkout-location-settings.md create mode 100644 legacy/doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay-eligibility-range.md create mode 100644 legacy/doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay.md create mode 100644 legacy/doc/models/checkout-merchant-settings-payment-methods-payment-method.md create mode 100644 legacy/doc/models/checkout-merchant-settings-payment-methods.md create mode 100644 legacy/doc/models/checkout-merchant-settings.md create mode 100644 legacy/doc/models/checkout-options-payment-type.md create mode 100644 legacy/doc/models/checkout-options.md create mode 100644 legacy/doc/models/checkout.md create mode 100644 legacy/doc/models/clearpay-details.md create mode 100644 legacy/doc/models/clone-order-request.md create mode 100644 legacy/doc/models/clone-order-response.md create mode 100644 legacy/doc/models/collected-data.md create mode 100644 legacy/doc/models/complete-payment-request.md create mode 100644 legacy/doc/models/complete-payment-response.md create mode 100644 legacy/doc/models/component-component-type.md create mode 100644 legacy/doc/models/component.md create mode 100644 legacy/doc/models/confirmation-decision.md create mode 100644 legacy/doc/models/confirmation-options.md create mode 100644 legacy/doc/models/coordinates.md create mode 100644 legacy/doc/models/country.md create mode 100644 legacy/doc/models/create-booking-custom-attribute-definition-request.md create mode 100644 legacy/doc/models/create-booking-custom-attribute-definition-response.md create mode 100644 legacy/doc/models/create-booking-request.md create mode 100644 legacy/doc/models/create-booking-response.md create mode 100644 legacy/doc/models/create-break-type-request.md create mode 100644 legacy/doc/models/create-break-type-response.md create mode 100644 legacy/doc/models/create-card-request.md create mode 100644 legacy/doc/models/create-card-response.md create mode 100644 legacy/doc/models/create-catalog-image-request.md create mode 100644 legacy/doc/models/create-catalog-image-response.md create mode 100644 legacy/doc/models/create-checkout-request.md create mode 100644 legacy/doc/models/create-checkout-response.md create mode 100644 legacy/doc/models/create-customer-card-request.md create mode 100644 legacy/doc/models/create-customer-card-response.md create mode 100644 legacy/doc/models/create-customer-custom-attribute-definition-request.md create mode 100644 legacy/doc/models/create-customer-custom-attribute-definition-response.md create mode 100644 legacy/doc/models/create-customer-group-request.md create mode 100644 legacy/doc/models/create-customer-group-response.md create mode 100644 legacy/doc/models/create-customer-request.md create mode 100644 legacy/doc/models/create-customer-response.md create mode 100644 legacy/doc/models/create-device-code-request.md create mode 100644 legacy/doc/models/create-device-code-response.md create mode 100644 legacy/doc/models/create-dispute-evidence-file-request.md create mode 100644 legacy/doc/models/create-dispute-evidence-file-response.md create mode 100644 legacy/doc/models/create-dispute-evidence-text-request.md create mode 100644 legacy/doc/models/create-dispute-evidence-text-response.md create mode 100644 legacy/doc/models/create-gift-card-activity-request.md create mode 100644 legacy/doc/models/create-gift-card-activity-response.md create mode 100644 legacy/doc/models/create-gift-card-request.md create mode 100644 legacy/doc/models/create-gift-card-response.md create mode 100644 legacy/doc/models/create-invoice-attachment-request.md create mode 100644 legacy/doc/models/create-invoice-attachment-response.md create mode 100644 legacy/doc/models/create-invoice-request.md create mode 100644 legacy/doc/models/create-invoice-response.md create mode 100644 legacy/doc/models/create-job-request.md create mode 100644 legacy/doc/models/create-job-response.md create mode 100644 legacy/doc/models/create-location-custom-attribute-definition-request.md create mode 100644 legacy/doc/models/create-location-custom-attribute-definition-response.md create mode 100644 legacy/doc/models/create-location-request.md create mode 100644 legacy/doc/models/create-location-response.md create mode 100644 legacy/doc/models/create-loyalty-account-request.md create mode 100644 legacy/doc/models/create-loyalty-account-response.md create mode 100644 legacy/doc/models/create-loyalty-promotion-request.md create mode 100644 legacy/doc/models/create-loyalty-promotion-response.md create mode 100644 legacy/doc/models/create-loyalty-reward-request.md create mode 100644 legacy/doc/models/create-loyalty-reward-response.md create mode 100644 legacy/doc/models/create-merchant-custom-attribute-definition-request.md create mode 100644 legacy/doc/models/create-merchant-custom-attribute-definition-response.md create mode 100644 legacy/doc/models/create-mobile-authorization-code-request.md create mode 100644 legacy/doc/models/create-mobile-authorization-code-response.md create mode 100644 legacy/doc/models/create-order-custom-attribute-definition-request.md create mode 100644 legacy/doc/models/create-order-custom-attribute-definition-response.md create mode 100644 legacy/doc/models/create-order-request.md create mode 100644 legacy/doc/models/create-order-response.md create mode 100644 legacy/doc/models/create-payment-link-request.md create mode 100644 legacy/doc/models/create-payment-link-response.md create mode 100644 legacy/doc/models/create-payment-request.md create mode 100644 legacy/doc/models/create-payment-response.md create mode 100644 legacy/doc/models/create-refund-request.md create mode 100644 legacy/doc/models/create-refund-response.md create mode 100644 legacy/doc/models/create-shift-request.md create mode 100644 legacy/doc/models/create-shift-response.md create mode 100644 legacy/doc/models/create-subscription-request.md create mode 100644 legacy/doc/models/create-subscription-response.md create mode 100644 legacy/doc/models/create-team-member-request.md create mode 100644 legacy/doc/models/create-team-member-response.md create mode 100644 legacy/doc/models/create-terminal-action-request.md create mode 100644 legacy/doc/models/create-terminal-action-response.md create mode 100644 legacy/doc/models/create-terminal-checkout-request.md create mode 100644 legacy/doc/models/create-terminal-checkout-response.md create mode 100644 legacy/doc/models/create-terminal-refund-request.md create mode 100644 legacy/doc/models/create-terminal-refund-response.md create mode 100644 legacy/doc/models/create-vendor-request.md create mode 100644 legacy/doc/models/create-vendor-response.md create mode 100644 legacy/doc/models/create-webhook-subscription-request.md create mode 100644 legacy/doc/models/create-webhook-subscription-response.md create mode 100644 legacy/doc/models/currency.md create mode 100644 legacy/doc/models/custom-attribute-definition-visibility.md create mode 100644 legacy/doc/models/custom-attribute-definition.md create mode 100644 legacy/doc/models/custom-attribute-filter.md create mode 100644 legacy/doc/models/custom-attribute.md create mode 100644 legacy/doc/models/custom-field.md create mode 100644 legacy/doc/models/customer-address-filter.md create mode 100644 legacy/doc/models/customer-creation-source-filter.md create mode 100644 legacy/doc/models/customer-creation-source.md create mode 100644 legacy/doc/models/customer-custom-attribute-filter-value.md create mode 100644 legacy/doc/models/customer-custom-attribute-filter.md create mode 100644 legacy/doc/models/customer-custom-attribute-filters.md create mode 100644 legacy/doc/models/customer-details.md create mode 100644 legacy/doc/models/customer-filter.md create mode 100644 legacy/doc/models/customer-group.md create mode 100644 legacy/doc/models/customer-inclusion-exclusion.md create mode 100644 legacy/doc/models/customer-preferences.md create mode 100644 legacy/doc/models/customer-query.md create mode 100644 legacy/doc/models/customer-segment.md create mode 100644 legacy/doc/models/customer-sort-field.md create mode 100644 legacy/doc/models/customer-sort.md create mode 100644 legacy/doc/models/customer-tax-ids.md create mode 100644 legacy/doc/models/customer-text-filter.md create mode 100644 legacy/doc/models/customer.md create mode 100644 legacy/doc/models/data-collection-options-input-type.md create mode 100644 legacy/doc/models/data-collection-options.md create mode 100644 legacy/doc/models/date-range.md create mode 100644 legacy/doc/models/day-of-week.md create mode 100644 legacy/doc/models/delete-booking-custom-attribute-definition-response.md create mode 100644 legacy/doc/models/delete-booking-custom-attribute-response.md create mode 100644 legacy/doc/models/delete-break-type-response.md create mode 100644 legacy/doc/models/delete-catalog-object-response.md create mode 100644 legacy/doc/models/delete-customer-card-response.md create mode 100644 legacy/doc/models/delete-customer-custom-attribute-definition-response.md create mode 100644 legacy/doc/models/delete-customer-custom-attribute-response.md create mode 100644 legacy/doc/models/delete-customer-group-response.md create mode 100644 legacy/doc/models/delete-customer-request.md create mode 100644 legacy/doc/models/delete-customer-response.md create mode 100644 legacy/doc/models/delete-dispute-evidence-response.md create mode 100644 legacy/doc/models/delete-invoice-attachment-response.md create mode 100644 legacy/doc/models/delete-invoice-request.md create mode 100644 legacy/doc/models/delete-invoice-response.md create mode 100644 legacy/doc/models/delete-location-custom-attribute-definition-response.md create mode 100644 legacy/doc/models/delete-location-custom-attribute-response.md create mode 100644 legacy/doc/models/delete-loyalty-reward-response.md create mode 100644 legacy/doc/models/delete-merchant-custom-attribute-definition-response.md create mode 100644 legacy/doc/models/delete-merchant-custom-attribute-response.md create mode 100644 legacy/doc/models/delete-order-custom-attribute-definition-response.md create mode 100644 legacy/doc/models/delete-order-custom-attribute-response.md create mode 100644 legacy/doc/models/delete-payment-link-response.md create mode 100644 legacy/doc/models/delete-shift-response.md create mode 100644 legacy/doc/models/delete-snippet-response.md create mode 100644 legacy/doc/models/delete-subscription-action-response.md create mode 100644 legacy/doc/models/delete-webhook-subscription-response.md create mode 100644 legacy/doc/models/deprecated-create-dispute-evidence-file-request.md create mode 100644 legacy/doc/models/deprecated-create-dispute-evidence-file-response.md create mode 100644 legacy/doc/models/deprecated-create-dispute-evidence-text-request.md create mode 100644 legacy/doc/models/deprecated-create-dispute-evidence-text-response.md create mode 100644 legacy/doc/models/destination-details-card-refund-details.md create mode 100644 legacy/doc/models/destination-details-cash-refund-details.md create mode 100644 legacy/doc/models/destination-details-external-refund-details.md create mode 100644 legacy/doc/models/destination-details.md create mode 100644 legacy/doc/models/destination-type.md create mode 100644 legacy/doc/models/destination.md create mode 100644 legacy/doc/models/device-attributes-device-type.md create mode 100644 legacy/doc/models/device-attributes.md create mode 100644 legacy/doc/models/device-checkout-options.md create mode 100644 legacy/doc/models/device-code-status.md create mode 100644 legacy/doc/models/device-code.md create mode 100644 legacy/doc/models/device-component-details-application-details.md create mode 100644 legacy/doc/models/device-component-details-battery-details.md create mode 100644 legacy/doc/models/device-component-details-card-reader-details.md create mode 100644 legacy/doc/models/device-component-details-ethernet-details.md create mode 100644 legacy/doc/models/device-component-details-external-power.md create mode 100644 legacy/doc/models/device-component-details-measurement.md create mode 100644 legacy/doc/models/device-component-details-network-interface-details.md create mode 100644 legacy/doc/models/device-component-details-wi-fi-details.md create mode 100644 legacy/doc/models/device-details.md create mode 100644 legacy/doc/models/device-metadata.md create mode 100644 legacy/doc/models/device-status-category.md create mode 100644 legacy/doc/models/device-status.md create mode 100644 legacy/doc/models/device.md create mode 100644 legacy/doc/models/digital-wallet-details.md create mode 100644 legacy/doc/models/disable-card-response.md create mode 100644 legacy/doc/models/disable-events-response.md create mode 100644 legacy/doc/models/dismiss-terminal-action-response.md create mode 100644 legacy/doc/models/dismiss-terminal-checkout-response.md create mode 100644 legacy/doc/models/dismiss-terminal-refund-response.md create mode 100644 legacy/doc/models/dispute-evidence-file.md create mode 100644 legacy/doc/models/dispute-evidence-type.md create mode 100644 legacy/doc/models/dispute-evidence.md create mode 100644 legacy/doc/models/dispute-reason.md create mode 100644 legacy/doc/models/dispute-state.md create mode 100644 legacy/doc/models/dispute.md create mode 100644 legacy/doc/models/disputed-payment.md create mode 100644 legacy/doc/models/ecom-visibility.md create mode 100644 legacy/doc/models/employee-status.md create mode 100644 legacy/doc/models/employee-wage.md create mode 100644 legacy/doc/models/employee.md create mode 100644 legacy/doc/models/enable-events-response.md create mode 100644 legacy/doc/models/error-category.md create mode 100644 legacy/doc/models/error-code.md create mode 100644 legacy/doc/models/error.md create mode 100644 legacy/doc/models/event-data.md create mode 100644 legacy/doc/models/event-metadata.md create mode 100644 legacy/doc/models/event-type-metadata.md create mode 100644 legacy/doc/models/event.md create mode 100644 legacy/doc/models/exclude-strategy.md create mode 100644 legacy/doc/models/external-payment-details.md create mode 100644 legacy/doc/models/filter-value.md create mode 100644 legacy/doc/models/float-number-range.md create mode 100644 legacy/doc/models/fulfillment-delivery-details-order-fulfillment-delivery-details-schedule-type.md create mode 100644 legacy/doc/models/fulfillment-delivery-details.md create mode 100644 legacy/doc/models/fulfillment-fulfillment-entry.md create mode 100644 legacy/doc/models/fulfillment-fulfillment-line-item-application.md create mode 100644 legacy/doc/models/fulfillment-pickup-details-curbside-pickup-details.md create mode 100644 legacy/doc/models/fulfillment-pickup-details-schedule-type.md create mode 100644 legacy/doc/models/fulfillment-pickup-details.md create mode 100644 legacy/doc/models/fulfillment-recipient.md create mode 100644 legacy/doc/models/fulfillment-shipment-details.md create mode 100644 legacy/doc/models/fulfillment-state.md create mode 100644 legacy/doc/models/fulfillment-type.md create mode 100644 legacy/doc/models/fulfillment.md create mode 100644 legacy/doc/models/get-bank-account-by-v1-id-response.md create mode 100644 legacy/doc/models/get-bank-account-response.md create mode 100644 legacy/doc/models/get-break-type-response.md create mode 100644 legacy/doc/models/get-device-code-response.md create mode 100644 legacy/doc/models/get-device-response.md create mode 100644 legacy/doc/models/get-employee-wage-response.md create mode 100644 legacy/doc/models/get-invoice-response.md create mode 100644 legacy/doc/models/get-payment-refund-response.md create mode 100644 legacy/doc/models/get-payment-response.md create mode 100644 legacy/doc/models/get-payout-response.md create mode 100644 legacy/doc/models/get-shift-response.md create mode 100644 legacy/doc/models/get-team-member-wage-response.md create mode 100644 legacy/doc/models/get-terminal-action-response.md create mode 100644 legacy/doc/models/get-terminal-checkout-response.md create mode 100644 legacy/doc/models/get-terminal-refund-response.md create mode 100644 legacy/doc/models/gift-card-activity-activate.md create mode 100644 legacy/doc/models/gift-card-activity-adjust-decrement-reason.md create mode 100644 legacy/doc/models/gift-card-activity-adjust-decrement.md create mode 100644 legacy/doc/models/gift-card-activity-adjust-increment-reason.md create mode 100644 legacy/doc/models/gift-card-activity-adjust-increment.md create mode 100644 legacy/doc/models/gift-card-activity-block-reason.md create mode 100644 legacy/doc/models/gift-card-activity-block.md create mode 100644 legacy/doc/models/gift-card-activity-clear-balance-reason.md create mode 100644 legacy/doc/models/gift-card-activity-clear-balance.md create mode 100644 legacy/doc/models/gift-card-activity-deactivate-reason.md create mode 100644 legacy/doc/models/gift-card-activity-deactivate.md create mode 100644 legacy/doc/models/gift-card-activity-import-reversal.md create mode 100644 legacy/doc/models/gift-card-activity-import.md create mode 100644 legacy/doc/models/gift-card-activity-load.md create mode 100644 legacy/doc/models/gift-card-activity-redeem-status.md create mode 100644 legacy/doc/models/gift-card-activity-redeem.md create mode 100644 legacy/doc/models/gift-card-activity-refund.md create mode 100644 legacy/doc/models/gift-card-activity-transfer-balance-from.md create mode 100644 legacy/doc/models/gift-card-activity-transfer-balance-to.md create mode 100644 legacy/doc/models/gift-card-activity-type.md create mode 100644 legacy/doc/models/gift-card-activity-unblock-reason.md create mode 100644 legacy/doc/models/gift-card-activity-unblock.md create mode 100644 legacy/doc/models/gift-card-activity-unlinked-activity-refund.md create mode 100644 legacy/doc/models/gift-card-activity.md create mode 100644 legacy/doc/models/gift-card-gan-source.md create mode 100644 legacy/doc/models/gift-card-status.md create mode 100644 legacy/doc/models/gift-card-type.md create mode 100644 legacy/doc/models/gift-card.md create mode 100644 legacy/doc/models/inventory-adjustment-group.md create mode 100644 legacy/doc/models/inventory-adjustment.md create mode 100644 legacy/doc/models/inventory-alert-type.md create mode 100644 legacy/doc/models/inventory-change-type.md create mode 100644 legacy/doc/models/inventory-change.md create mode 100644 legacy/doc/models/inventory-count.md create mode 100644 legacy/doc/models/inventory-physical-count.md create mode 100644 legacy/doc/models/inventory-state.md create mode 100644 legacy/doc/models/inventory-transfer.md create mode 100644 legacy/doc/models/invoice-accepted-payment-methods.md create mode 100644 legacy/doc/models/invoice-attachment.md create mode 100644 legacy/doc/models/invoice-automatic-payment-source.md create mode 100644 legacy/doc/models/invoice-custom-field-placement.md create mode 100644 legacy/doc/models/invoice-custom-field.md create mode 100644 legacy/doc/models/invoice-delivery-method.md create mode 100644 legacy/doc/models/invoice-filter.md create mode 100644 legacy/doc/models/invoice-payment-reminder-status.md create mode 100644 legacy/doc/models/invoice-payment-reminder.md create mode 100644 legacy/doc/models/invoice-payment-request.md create mode 100644 legacy/doc/models/invoice-query.md create mode 100644 legacy/doc/models/invoice-recipient-tax-ids.md create mode 100644 legacy/doc/models/invoice-recipient.md create mode 100644 legacy/doc/models/invoice-request-method.md create mode 100644 legacy/doc/models/invoice-request-type.md create mode 100644 legacy/doc/models/invoice-sort-field.md create mode 100644 legacy/doc/models/invoice-sort.md create mode 100644 legacy/doc/models/invoice-status.md create mode 100644 legacy/doc/models/invoice.md create mode 100644 legacy/doc/models/item-variation-location-overrides.md create mode 100644 legacy/doc/models/job-assignment-pay-type.md create mode 100644 legacy/doc/models/job-assignment.md create mode 100644 legacy/doc/models/job.md create mode 100644 legacy/doc/models/link-customer-to-gift-card-request.md create mode 100644 legacy/doc/models/link-customer-to-gift-card-response.md create mode 100644 legacy/doc/models/list-bank-accounts-request.md create mode 100644 legacy/doc/models/list-bank-accounts-response.md create mode 100644 legacy/doc/models/list-booking-custom-attribute-definitions-request.md create mode 100644 legacy/doc/models/list-booking-custom-attribute-definitions-response.md create mode 100644 legacy/doc/models/list-booking-custom-attributes-request.md create mode 100644 legacy/doc/models/list-booking-custom-attributes-response.md create mode 100644 legacy/doc/models/list-bookings-request.md create mode 100644 legacy/doc/models/list-bookings-response.md create mode 100644 legacy/doc/models/list-break-types-request.md create mode 100644 legacy/doc/models/list-break-types-response.md create mode 100644 legacy/doc/models/list-cards-request.md create mode 100644 legacy/doc/models/list-cards-response.md create mode 100644 legacy/doc/models/list-cash-drawer-shift-events-request.md create mode 100644 legacy/doc/models/list-cash-drawer-shift-events-response.md create mode 100644 legacy/doc/models/list-cash-drawer-shifts-request.md create mode 100644 legacy/doc/models/list-cash-drawer-shifts-response.md create mode 100644 legacy/doc/models/list-catalog-request.md create mode 100644 legacy/doc/models/list-catalog-response.md create mode 100644 legacy/doc/models/list-customer-custom-attribute-definitions-request.md create mode 100644 legacy/doc/models/list-customer-custom-attribute-definitions-response.md create mode 100644 legacy/doc/models/list-customer-custom-attributes-request.md create mode 100644 legacy/doc/models/list-customer-custom-attributes-response.md create mode 100644 legacy/doc/models/list-customer-groups-request.md create mode 100644 legacy/doc/models/list-customer-groups-response.md create mode 100644 legacy/doc/models/list-customer-segments-request.md create mode 100644 legacy/doc/models/list-customer-segments-response.md create mode 100644 legacy/doc/models/list-customers-request.md create mode 100644 legacy/doc/models/list-customers-response.md create mode 100644 legacy/doc/models/list-device-codes-request.md create mode 100644 legacy/doc/models/list-device-codes-response.md create mode 100644 legacy/doc/models/list-devices-request.md create mode 100644 legacy/doc/models/list-devices-response.md create mode 100644 legacy/doc/models/list-dispute-evidence-request.md create mode 100644 legacy/doc/models/list-dispute-evidence-response.md create mode 100644 legacy/doc/models/list-disputes-request.md create mode 100644 legacy/doc/models/list-disputes-response.md create mode 100644 legacy/doc/models/list-employee-wages-request.md create mode 100644 legacy/doc/models/list-employee-wages-response.md create mode 100644 legacy/doc/models/list-employees-request.md create mode 100644 legacy/doc/models/list-employees-response.md create mode 100644 legacy/doc/models/list-event-types-request.md create mode 100644 legacy/doc/models/list-event-types-response.md create mode 100644 legacy/doc/models/list-gift-card-activities-request.md create mode 100644 legacy/doc/models/list-gift-card-activities-response.md create mode 100644 legacy/doc/models/list-gift-cards-request.md create mode 100644 legacy/doc/models/list-gift-cards-response.md create mode 100644 legacy/doc/models/list-invoices-request.md create mode 100644 legacy/doc/models/list-invoices-response.md create mode 100644 legacy/doc/models/list-jobs-request.md create mode 100644 legacy/doc/models/list-jobs-response.md create mode 100644 legacy/doc/models/list-location-booking-profiles-request.md create mode 100644 legacy/doc/models/list-location-booking-profiles-response.md create mode 100644 legacy/doc/models/list-location-custom-attribute-definitions-request.md create mode 100644 legacy/doc/models/list-location-custom-attribute-definitions-response.md create mode 100644 legacy/doc/models/list-location-custom-attributes-request.md create mode 100644 legacy/doc/models/list-location-custom-attributes-response.md create mode 100644 legacy/doc/models/list-locations-response.md create mode 100644 legacy/doc/models/list-loyalty-programs-response.md create mode 100644 legacy/doc/models/list-loyalty-promotions-request.md create mode 100644 legacy/doc/models/list-loyalty-promotions-response.md create mode 100644 legacy/doc/models/list-merchant-custom-attribute-definitions-request.md create mode 100644 legacy/doc/models/list-merchant-custom-attribute-definitions-response.md create mode 100644 legacy/doc/models/list-merchant-custom-attributes-request.md create mode 100644 legacy/doc/models/list-merchant-custom-attributes-response.md create mode 100644 legacy/doc/models/list-merchants-request.md create mode 100644 legacy/doc/models/list-merchants-response.md create mode 100644 legacy/doc/models/list-order-custom-attribute-definitions-request.md create mode 100644 legacy/doc/models/list-order-custom-attribute-definitions-response.md create mode 100644 legacy/doc/models/list-order-custom-attributes-request.md create mode 100644 legacy/doc/models/list-order-custom-attributes-response.md create mode 100644 legacy/doc/models/list-payment-links-request.md create mode 100644 legacy/doc/models/list-payment-links-response.md create mode 100644 legacy/doc/models/list-payment-refunds-request.md create mode 100644 legacy/doc/models/list-payment-refunds-response.md create mode 100644 legacy/doc/models/list-payments-request.md create mode 100644 legacy/doc/models/list-payments-response.md create mode 100644 legacy/doc/models/list-payout-entries-request.md create mode 100644 legacy/doc/models/list-payout-entries-response.md create mode 100644 legacy/doc/models/list-payouts-request.md create mode 100644 legacy/doc/models/list-payouts-response.md create mode 100644 legacy/doc/models/list-refunds-request.md create mode 100644 legacy/doc/models/list-refunds-response.md create mode 100644 legacy/doc/models/list-sites-response.md create mode 100644 legacy/doc/models/list-subscription-events-request.md create mode 100644 legacy/doc/models/list-subscription-events-response.md create mode 100644 legacy/doc/models/list-team-member-booking-profiles-request.md create mode 100644 legacy/doc/models/list-team-member-booking-profiles-response.md create mode 100644 legacy/doc/models/list-team-member-wages-request.md create mode 100644 legacy/doc/models/list-team-member-wages-response.md create mode 100644 legacy/doc/models/list-transactions-request.md create mode 100644 legacy/doc/models/list-transactions-response.md create mode 100644 legacy/doc/models/list-webhook-event-types-request.md create mode 100644 legacy/doc/models/list-webhook-event-types-response.md create mode 100644 legacy/doc/models/list-webhook-subscriptions-request.md create mode 100644 legacy/doc/models/list-webhook-subscriptions-response.md create mode 100644 legacy/doc/models/list-workweek-configs-request.md create mode 100644 legacy/doc/models/list-workweek-configs-response.md create mode 100644 legacy/doc/models/location-booking-profile.md create mode 100644 legacy/doc/models/location-capability.md create mode 100644 legacy/doc/models/location-status.md create mode 100644 legacy/doc/models/location-type.md create mode 100644 legacy/doc/models/location.md create mode 100644 legacy/doc/models/loyalty-account-expiring-point-deadline.md create mode 100644 legacy/doc/models/loyalty-account-mapping-type.md create mode 100644 legacy/doc/models/loyalty-account-mapping.md create mode 100644 legacy/doc/models/loyalty-account.md create mode 100644 legacy/doc/models/loyalty-event-accumulate-points.md create mode 100644 legacy/doc/models/loyalty-event-accumulate-promotion-points.md create mode 100644 legacy/doc/models/loyalty-event-adjust-points.md create mode 100644 legacy/doc/models/loyalty-event-create-reward.md create mode 100644 legacy/doc/models/loyalty-event-date-time-filter.md create mode 100644 legacy/doc/models/loyalty-event-delete-reward.md create mode 100644 legacy/doc/models/loyalty-event-expire-points.md create mode 100644 legacy/doc/models/loyalty-event-filter.md create mode 100644 legacy/doc/models/loyalty-event-location-filter.md create mode 100644 legacy/doc/models/loyalty-event-loyalty-account-filter.md create mode 100644 legacy/doc/models/loyalty-event-order-filter.md create mode 100644 legacy/doc/models/loyalty-event-other.md create mode 100644 legacy/doc/models/loyalty-event-query.md create mode 100644 legacy/doc/models/loyalty-event-redeem-reward.md create mode 100644 legacy/doc/models/loyalty-event-source.md create mode 100644 legacy/doc/models/loyalty-event-type-filter.md create mode 100644 legacy/doc/models/loyalty-event-type.md create mode 100644 legacy/doc/models/loyalty-event.md create mode 100644 legacy/doc/models/loyalty-program-accrual-rule-category-data.md create mode 100644 legacy/doc/models/loyalty-program-accrual-rule-item-variation-data.md create mode 100644 legacy/doc/models/loyalty-program-accrual-rule-spend-data.md create mode 100644 legacy/doc/models/loyalty-program-accrual-rule-tax-mode.md create mode 100644 legacy/doc/models/loyalty-program-accrual-rule-type.md create mode 100644 legacy/doc/models/loyalty-program-accrual-rule-visit-data.md create mode 100644 legacy/doc/models/loyalty-program-accrual-rule.md create mode 100644 legacy/doc/models/loyalty-program-expiration-policy.md create mode 100644 legacy/doc/models/loyalty-program-reward-definition-scope.md create mode 100644 legacy/doc/models/loyalty-program-reward-definition-type.md create mode 100644 legacy/doc/models/loyalty-program-reward-definition.md create mode 100644 legacy/doc/models/loyalty-program-reward-tier.md create mode 100644 legacy/doc/models/loyalty-program-status.md create mode 100644 legacy/doc/models/loyalty-program-terminology.md create mode 100644 legacy/doc/models/loyalty-program.md create mode 100644 legacy/doc/models/loyalty-promotion-available-time-data.md create mode 100644 legacy/doc/models/loyalty-promotion-incentive-points-addition-data.md create mode 100644 legacy/doc/models/loyalty-promotion-incentive-points-multiplier-data.md create mode 100644 legacy/doc/models/loyalty-promotion-incentive-type.md create mode 100644 legacy/doc/models/loyalty-promotion-incentive.md create mode 100644 legacy/doc/models/loyalty-promotion-status.md create mode 100644 legacy/doc/models/loyalty-promotion-trigger-limit-interval.md create mode 100644 legacy/doc/models/loyalty-promotion-trigger-limit.md create mode 100644 legacy/doc/models/loyalty-promotion.md create mode 100644 legacy/doc/models/loyalty-reward-status.md create mode 100644 legacy/doc/models/loyalty-reward.md create mode 100644 legacy/doc/models/measurement-unit-area.md create mode 100644 legacy/doc/models/measurement-unit-custom.md create mode 100644 legacy/doc/models/measurement-unit-generic.md create mode 100644 legacy/doc/models/measurement-unit-length.md create mode 100644 legacy/doc/models/measurement-unit-time.md create mode 100644 legacy/doc/models/measurement-unit-unit-type.md create mode 100644 legacy/doc/models/measurement-unit-volume.md create mode 100644 legacy/doc/models/measurement-unit-weight.md create mode 100644 legacy/doc/models/measurement-unit.md create mode 100644 legacy/doc/models/merchant-status.md create mode 100644 legacy/doc/models/merchant.md create mode 100644 legacy/doc/models/modifier-location-overrides.md create mode 100644 legacy/doc/models/money.md create mode 100644 legacy/doc/models/obtain-token-request.md create mode 100644 legacy/doc/models/obtain-token-response.md create mode 100644 legacy/doc/models/offline-payment-details.md create mode 100644 legacy/doc/models/order-created-object.md create mode 100644 legacy/doc/models/order-created.md create mode 100644 legacy/doc/models/order-entry.md create mode 100644 legacy/doc/models/order-fulfillment-delivery-details-schedule-type.md create mode 100644 legacy/doc/models/order-fulfillment-delivery-details.md create mode 100644 legacy/doc/models/order-fulfillment-fulfillment-entry.md create mode 100644 legacy/doc/models/order-fulfillment-fulfillment-line-item-application.md create mode 100644 legacy/doc/models/order-fulfillment-pickup-details-curbside-pickup-details.md create mode 100644 legacy/doc/models/order-fulfillment-pickup-details-schedule-type.md create mode 100644 legacy/doc/models/order-fulfillment-pickup-details.md create mode 100644 legacy/doc/models/order-fulfillment-recipient.md create mode 100644 legacy/doc/models/order-fulfillment-shipment-details.md create mode 100644 legacy/doc/models/order-fulfillment-state.md create mode 100644 legacy/doc/models/order-fulfillment-type.md create mode 100644 legacy/doc/models/order-fulfillment-updated-object.md create mode 100644 legacy/doc/models/order-fulfillment-updated-update.md create mode 100644 legacy/doc/models/order-fulfillment-updated.md create mode 100644 legacy/doc/models/order-fulfillment.md create mode 100644 legacy/doc/models/order-line-item-applied-discount.md create mode 100644 legacy/doc/models/order-line-item-applied-service-charge.md create mode 100644 legacy/doc/models/order-line-item-applied-tax.md create mode 100644 legacy/doc/models/order-line-item-discount-scope.md create mode 100644 legacy/doc/models/order-line-item-discount-type.md create mode 100644 legacy/doc/models/order-line-item-discount.md create mode 100644 legacy/doc/models/order-line-item-item-type.md create mode 100644 legacy/doc/models/order-line-item-modifier.md create mode 100644 legacy/doc/models/order-line-item-pricing-blocklists-blocked-discount.md create mode 100644 legacy/doc/models/order-line-item-pricing-blocklists-blocked-tax.md create mode 100644 legacy/doc/models/order-line-item-pricing-blocklists.md create mode 100644 legacy/doc/models/order-line-item-tax-scope.md create mode 100644 legacy/doc/models/order-line-item-tax-type.md create mode 100644 legacy/doc/models/order-line-item-tax.md create mode 100644 legacy/doc/models/order-line-item.md create mode 100644 legacy/doc/models/order-money-amounts.md create mode 100644 legacy/doc/models/order-pricing-options.md create mode 100644 legacy/doc/models/order-quantity-unit.md create mode 100644 legacy/doc/models/order-return-discount.md create mode 100644 legacy/doc/models/order-return-line-item-modifier.md create mode 100644 legacy/doc/models/order-return-line-item.md create mode 100644 legacy/doc/models/order-return-service-charge.md create mode 100644 legacy/doc/models/order-return-tax.md create mode 100644 legacy/doc/models/order-return-tip.md create mode 100644 legacy/doc/models/order-return.md create mode 100644 legacy/doc/models/order-reward.md create mode 100644 legacy/doc/models/order-rounding-adjustment.md create mode 100644 legacy/doc/models/order-service-charge-calculation-phase.md create mode 100644 legacy/doc/models/order-service-charge-scope.md create mode 100644 legacy/doc/models/order-service-charge-treatment-type.md create mode 100644 legacy/doc/models/order-service-charge-type.md create mode 100644 legacy/doc/models/order-service-charge.md create mode 100644 legacy/doc/models/order-source.md create mode 100644 legacy/doc/models/order-state.md create mode 100644 legacy/doc/models/order-updated-object.md create mode 100644 legacy/doc/models/order-updated.md create mode 100644 legacy/doc/models/order.md create mode 100644 legacy/doc/models/pagination-cursor.md create mode 100644 legacy/doc/models/pause-subscription-request.md create mode 100644 legacy/doc/models/pause-subscription-response.md create mode 100644 legacy/doc/models/pay-order-request.md create mode 100644 legacy/doc/models/pay-order-response.md create mode 100644 legacy/doc/models/payment-balance-activity-app-fee-refund-detail.md create mode 100644 legacy/doc/models/payment-balance-activity-app-fee-revenue-detail.md create mode 100644 legacy/doc/models/payment-balance-activity-automatic-savings-detail.md create mode 100644 legacy/doc/models/payment-balance-activity-automatic-savings-reversed-detail.md create mode 100644 legacy/doc/models/payment-balance-activity-charge-detail.md create mode 100644 legacy/doc/models/payment-balance-activity-deposit-fee-detail.md create mode 100644 legacy/doc/models/payment-balance-activity-deposit-fee-reversed-detail.md create mode 100644 legacy/doc/models/payment-balance-activity-dispute-detail.md create mode 100644 legacy/doc/models/payment-balance-activity-fee-detail.md create mode 100644 legacy/doc/models/payment-balance-activity-free-processing-detail.md create mode 100644 legacy/doc/models/payment-balance-activity-hold-adjustment-detail.md create mode 100644 legacy/doc/models/payment-balance-activity-open-dispute-detail.md create mode 100644 legacy/doc/models/payment-balance-activity-other-adjustment-detail.md create mode 100644 legacy/doc/models/payment-balance-activity-other-detail.md create mode 100644 legacy/doc/models/payment-balance-activity-refund-detail.md create mode 100644 legacy/doc/models/payment-balance-activity-release-adjustment-detail.md create mode 100644 legacy/doc/models/payment-balance-activity-reserve-hold-detail.md create mode 100644 legacy/doc/models/payment-balance-activity-reserve-release-detail.md create mode 100644 legacy/doc/models/payment-balance-activity-square-capital-payment-detail.md create mode 100644 legacy/doc/models/payment-balance-activity-square-capital-reversed-payment-detail.md create mode 100644 legacy/doc/models/payment-balance-activity-square-payroll-transfer-detail.md create mode 100644 legacy/doc/models/payment-balance-activity-square-payroll-transfer-reversed-detail.md create mode 100644 legacy/doc/models/payment-balance-activity-tax-on-fee-detail.md create mode 100644 legacy/doc/models/payment-balance-activity-third-party-fee-detail.md create mode 100644 legacy/doc/models/payment-balance-activity-third-party-fee-refund-detail.md create mode 100644 legacy/doc/models/payment-link-related-resources.md create mode 100644 legacy/doc/models/payment-link.md create mode 100644 legacy/doc/models/payment-options-delay-action.md create mode 100644 legacy/doc/models/payment-options.md create mode 100644 legacy/doc/models/payment-refund.md create mode 100644 legacy/doc/models/payment-sort-field.md create mode 100644 legacy/doc/models/payment.md create mode 100644 legacy/doc/models/payout-entry.md create mode 100644 legacy/doc/models/payout-fee-type.md create mode 100644 legacy/doc/models/payout-fee.md create mode 100644 legacy/doc/models/payout-status.md create mode 100644 legacy/doc/models/payout-type.md create mode 100644 legacy/doc/models/payout.md create mode 100644 legacy/doc/models/phase-input.md create mode 100644 legacy/doc/models/phase.md create mode 100644 legacy/doc/models/pre-populated-data.md create mode 100644 legacy/doc/models/processing-fee.md create mode 100644 legacy/doc/models/product-type.md create mode 100644 legacy/doc/models/product.md create mode 100644 legacy/doc/models/publish-invoice-request.md create mode 100644 legacy/doc/models/publish-invoice-response.md create mode 100644 legacy/doc/models/qr-code-options.md create mode 100644 legacy/doc/models/quantity-ratio.md create mode 100644 legacy/doc/models/quick-pay.md create mode 100644 legacy/doc/models/range.md create mode 100644 legacy/doc/models/receipt-options.md create mode 100644 legacy/doc/models/redeem-loyalty-reward-request.md create mode 100644 legacy/doc/models/redeem-loyalty-reward-response.md create mode 100644 legacy/doc/models/refund-payment-request.md create mode 100644 legacy/doc/models/refund-payment-response.md create mode 100644 legacy/doc/models/refund-status.md create mode 100644 legacy/doc/models/refund.md create mode 100644 legacy/doc/models/register-domain-request.md create mode 100644 legacy/doc/models/register-domain-response-status.md create mode 100644 legacy/doc/models/register-domain-response.md create mode 100644 legacy/doc/models/remove-group-from-customer-response.md create mode 100644 legacy/doc/models/resume-subscription-request.md create mode 100644 legacy/doc/models/resume-subscription-response.md create mode 100644 legacy/doc/models/retrieve-booking-custom-attribute-definition-request.md create mode 100644 legacy/doc/models/retrieve-booking-custom-attribute-definition-response.md create mode 100644 legacy/doc/models/retrieve-booking-custom-attribute-request.md create mode 100644 legacy/doc/models/retrieve-booking-custom-attribute-response.md create mode 100644 legacy/doc/models/retrieve-booking-response.md create mode 100644 legacy/doc/models/retrieve-business-booking-profile-response.md create mode 100644 legacy/doc/models/retrieve-card-response.md create mode 100644 legacy/doc/models/retrieve-cash-drawer-shift-request.md create mode 100644 legacy/doc/models/retrieve-cash-drawer-shift-response.md create mode 100644 legacy/doc/models/retrieve-catalog-object-request.md create mode 100644 legacy/doc/models/retrieve-catalog-object-response.md create mode 100644 legacy/doc/models/retrieve-customer-custom-attribute-definition-request.md create mode 100644 legacy/doc/models/retrieve-customer-custom-attribute-definition-response.md create mode 100644 legacy/doc/models/retrieve-customer-custom-attribute-request.md create mode 100644 legacy/doc/models/retrieve-customer-custom-attribute-response.md create mode 100644 legacy/doc/models/retrieve-customer-group-response.md create mode 100644 legacy/doc/models/retrieve-customer-response.md create mode 100644 legacy/doc/models/retrieve-customer-segment-response.md create mode 100644 legacy/doc/models/retrieve-dispute-evidence-response.md create mode 100644 legacy/doc/models/retrieve-dispute-response.md create mode 100644 legacy/doc/models/retrieve-employee-response.md create mode 100644 legacy/doc/models/retrieve-gift-card-from-gan-request.md create mode 100644 legacy/doc/models/retrieve-gift-card-from-gan-response.md create mode 100644 legacy/doc/models/retrieve-gift-card-from-nonce-request.md create mode 100644 legacy/doc/models/retrieve-gift-card-from-nonce-response.md create mode 100644 legacy/doc/models/retrieve-gift-card-response.md create mode 100644 legacy/doc/models/retrieve-inventory-adjustment-response.md create mode 100644 legacy/doc/models/retrieve-inventory-changes-request.md create mode 100644 legacy/doc/models/retrieve-inventory-changes-response.md create mode 100644 legacy/doc/models/retrieve-inventory-count-request.md create mode 100644 legacy/doc/models/retrieve-inventory-count-response.md create mode 100644 legacy/doc/models/retrieve-inventory-physical-count-response.md create mode 100644 legacy/doc/models/retrieve-inventory-transfer-response.md create mode 100644 legacy/doc/models/retrieve-job-response.md create mode 100644 legacy/doc/models/retrieve-location-booking-profile-response.md create mode 100644 legacy/doc/models/retrieve-location-custom-attribute-definition-request.md create mode 100644 legacy/doc/models/retrieve-location-custom-attribute-definition-response.md create mode 100644 legacy/doc/models/retrieve-location-custom-attribute-request.md create mode 100644 legacy/doc/models/retrieve-location-custom-attribute-response.md create mode 100644 legacy/doc/models/retrieve-location-response.md create mode 100644 legacy/doc/models/retrieve-location-settings-response.md create mode 100644 legacy/doc/models/retrieve-loyalty-account-response.md create mode 100644 legacy/doc/models/retrieve-loyalty-program-response.md create mode 100644 legacy/doc/models/retrieve-loyalty-promotion-response.md create mode 100644 legacy/doc/models/retrieve-loyalty-reward-response.md create mode 100644 legacy/doc/models/retrieve-merchant-custom-attribute-definition-request.md create mode 100644 legacy/doc/models/retrieve-merchant-custom-attribute-definition-response.md create mode 100644 legacy/doc/models/retrieve-merchant-custom-attribute-request.md create mode 100644 legacy/doc/models/retrieve-merchant-custom-attribute-response.md create mode 100644 legacy/doc/models/retrieve-merchant-response.md create mode 100644 legacy/doc/models/retrieve-merchant-settings-response.md create mode 100644 legacy/doc/models/retrieve-order-custom-attribute-definition-request.md create mode 100644 legacy/doc/models/retrieve-order-custom-attribute-definition-response.md create mode 100644 legacy/doc/models/retrieve-order-custom-attribute-request.md create mode 100644 legacy/doc/models/retrieve-order-custom-attribute-response.md create mode 100644 legacy/doc/models/retrieve-order-response.md create mode 100644 legacy/doc/models/retrieve-payment-link-response.md create mode 100644 legacy/doc/models/retrieve-snippet-response.md create mode 100644 legacy/doc/models/retrieve-subscription-request.md create mode 100644 legacy/doc/models/retrieve-subscription-response.md create mode 100644 legacy/doc/models/retrieve-team-member-booking-profile-response.md create mode 100644 legacy/doc/models/retrieve-team-member-response.md create mode 100644 legacy/doc/models/retrieve-token-status-response.md create mode 100644 legacy/doc/models/retrieve-transaction-response.md create mode 100644 legacy/doc/models/retrieve-vendor-response.md create mode 100644 legacy/doc/models/retrieve-wage-setting-response.md create mode 100644 legacy/doc/models/retrieve-webhook-subscription-response.md create mode 100644 legacy/doc/models/revoke-token-request.md create mode 100644 legacy/doc/models/revoke-token-response.md create mode 100644 legacy/doc/models/risk-evaluation-risk-level.md create mode 100644 legacy/doc/models/risk-evaluation.md create mode 100644 legacy/doc/models/save-card-options.md create mode 100644 legacy/doc/models/search-availability-filter.md create mode 100644 legacy/doc/models/search-availability-query.md create mode 100644 legacy/doc/models/search-availability-request.md create mode 100644 legacy/doc/models/search-availability-response.md create mode 100644 legacy/doc/models/search-catalog-items-request-stock-level.md create mode 100644 legacy/doc/models/search-catalog-items-request.md create mode 100644 legacy/doc/models/search-catalog-items-response.md create mode 100644 legacy/doc/models/search-catalog-objects-request.md create mode 100644 legacy/doc/models/search-catalog-objects-response.md create mode 100644 legacy/doc/models/search-customers-request.md create mode 100644 legacy/doc/models/search-customers-response.md create mode 100644 legacy/doc/models/search-events-filter.md create mode 100644 legacy/doc/models/search-events-query.md create mode 100644 legacy/doc/models/search-events-request.md create mode 100644 legacy/doc/models/search-events-response.md create mode 100644 legacy/doc/models/search-events-sort-field.md create mode 100644 legacy/doc/models/search-events-sort.md create mode 100644 legacy/doc/models/search-invoices-request.md create mode 100644 legacy/doc/models/search-invoices-response.md create mode 100644 legacy/doc/models/search-loyalty-accounts-request-loyalty-account-query.md create mode 100644 legacy/doc/models/search-loyalty-accounts-request.md create mode 100644 legacy/doc/models/search-loyalty-accounts-response.md create mode 100644 legacy/doc/models/search-loyalty-events-request.md create mode 100644 legacy/doc/models/search-loyalty-events-response.md create mode 100644 legacy/doc/models/search-loyalty-rewards-request-loyalty-reward-query.md create mode 100644 legacy/doc/models/search-loyalty-rewards-request.md create mode 100644 legacy/doc/models/search-loyalty-rewards-response.md create mode 100644 legacy/doc/models/search-orders-customer-filter.md create mode 100644 legacy/doc/models/search-orders-date-time-filter.md create mode 100644 legacy/doc/models/search-orders-filter.md create mode 100644 legacy/doc/models/search-orders-fulfillment-filter.md create mode 100644 legacy/doc/models/search-orders-query.md create mode 100644 legacy/doc/models/search-orders-request.md create mode 100644 legacy/doc/models/search-orders-response.md create mode 100644 legacy/doc/models/search-orders-sort-field.md create mode 100644 legacy/doc/models/search-orders-sort.md create mode 100644 legacy/doc/models/search-orders-source-filter.md create mode 100644 legacy/doc/models/search-orders-state-filter.md create mode 100644 legacy/doc/models/search-shifts-request.md create mode 100644 legacy/doc/models/search-shifts-response.md create mode 100644 legacy/doc/models/search-subscriptions-filter.md create mode 100644 legacy/doc/models/search-subscriptions-query.md create mode 100644 legacy/doc/models/search-subscriptions-request.md create mode 100644 legacy/doc/models/search-subscriptions-response.md create mode 100644 legacy/doc/models/search-team-members-filter.md create mode 100644 legacy/doc/models/search-team-members-query.md create mode 100644 legacy/doc/models/search-team-members-request.md create mode 100644 legacy/doc/models/search-team-members-response.md create mode 100644 legacy/doc/models/search-terminal-actions-request.md create mode 100644 legacy/doc/models/search-terminal-actions-response.md create mode 100644 legacy/doc/models/search-terminal-checkouts-request.md create mode 100644 legacy/doc/models/search-terminal-checkouts-response.md create mode 100644 legacy/doc/models/search-terminal-refunds-request.md create mode 100644 legacy/doc/models/search-terminal-refunds-response.md create mode 100644 legacy/doc/models/search-vendors-request-filter.md create mode 100644 legacy/doc/models/search-vendors-request-sort-field.md create mode 100644 legacy/doc/models/search-vendors-request-sort.md create mode 100644 legacy/doc/models/search-vendors-request.md create mode 100644 legacy/doc/models/search-vendors-response.md create mode 100644 legacy/doc/models/segment-filter.md create mode 100644 legacy/doc/models/select-option.md create mode 100644 legacy/doc/models/select-options.md create mode 100644 legacy/doc/models/shift-filter-status.md create mode 100644 legacy/doc/models/shift-filter.md create mode 100644 legacy/doc/models/shift-query.md create mode 100644 legacy/doc/models/shift-sort-field.md create mode 100644 legacy/doc/models/shift-sort.md create mode 100644 legacy/doc/models/shift-status.md create mode 100644 legacy/doc/models/shift-wage.md create mode 100644 legacy/doc/models/shift-workday-matcher.md create mode 100644 legacy/doc/models/shift-workday.md create mode 100644 legacy/doc/models/shift.md create mode 100644 legacy/doc/models/shipping-fee.md create mode 100644 legacy/doc/models/signature-image.md create mode 100644 legacy/doc/models/signature-options.md create mode 100644 legacy/doc/models/site.md create mode 100644 legacy/doc/models/snippet-response.md create mode 100644 legacy/doc/models/snippet.md create mode 100644 legacy/doc/models/sort-order.md create mode 100644 legacy/doc/models/source-application.md create mode 100644 legacy/doc/models/square-account-details.md create mode 100644 legacy/doc/models/standard-unit-description-group.md create mode 100644 legacy/doc/models/standard-unit-description.md create mode 100644 legacy/doc/models/submit-evidence-response.md create mode 100644 legacy/doc/models/subscription-action-type.md create mode 100644 legacy/doc/models/subscription-action.md create mode 100644 legacy/doc/models/subscription-cadence.md create mode 100644 legacy/doc/models/subscription-event-info-code.md create mode 100644 legacy/doc/models/subscription-event-info.md create mode 100644 legacy/doc/models/subscription-event-subscription-event-type.md create mode 100644 legacy/doc/models/subscription-event.md create mode 100644 legacy/doc/models/subscription-phase.md create mode 100644 legacy/doc/models/subscription-pricing-type.md create mode 100644 legacy/doc/models/subscription-pricing.md create mode 100644 legacy/doc/models/subscription-source.md create mode 100644 legacy/doc/models/subscription-status.md create mode 100644 legacy/doc/models/subscription-test-result.md create mode 100644 legacy/doc/models/subscription.md create mode 100644 legacy/doc/models/swap-plan-request.md create mode 100644 legacy/doc/models/swap-plan-response.md create mode 100644 legacy/doc/models/tax-calculation-phase.md create mode 100644 legacy/doc/models/tax-ids.md create mode 100644 legacy/doc/models/tax-inclusion-type.md create mode 100644 legacy/doc/models/team-member-assigned-locations-assignment-type.md create mode 100644 legacy/doc/models/team-member-assigned-locations.md create mode 100644 legacy/doc/models/team-member-booking-profile.md create mode 100644 legacy/doc/models/team-member-invitation-status.md create mode 100644 legacy/doc/models/team-member-status.md create mode 100644 legacy/doc/models/team-member-wage.md create mode 100644 legacy/doc/models/team-member.md create mode 100644 legacy/doc/models/tender-bank-account-details-status.md create mode 100644 legacy/doc/models/tender-bank-account-details.md create mode 100644 legacy/doc/models/tender-buy-now-pay-later-details-brand.md create mode 100644 legacy/doc/models/tender-buy-now-pay-later-details-status.md create mode 100644 legacy/doc/models/tender-buy-now-pay-later-details.md create mode 100644 legacy/doc/models/tender-card-details-entry-method.md create mode 100644 legacy/doc/models/tender-card-details-status.md create mode 100644 legacy/doc/models/tender-card-details.md create mode 100644 legacy/doc/models/tender-cash-details.md create mode 100644 legacy/doc/models/tender-square-account-details-status.md create mode 100644 legacy/doc/models/tender-square-account-details.md create mode 100644 legacy/doc/models/tender-type.md create mode 100644 legacy/doc/models/tender.md create mode 100644 legacy/doc/models/terminal-action-action-type.md create mode 100644 legacy/doc/models/terminal-action-query-filter.md create mode 100644 legacy/doc/models/terminal-action-query-sort.md create mode 100644 legacy/doc/models/terminal-action-query.md create mode 100644 legacy/doc/models/terminal-action.md create mode 100644 legacy/doc/models/terminal-checkout-query-filter.md create mode 100644 legacy/doc/models/terminal-checkout-query-sort.md create mode 100644 legacy/doc/models/terminal-checkout-query.md create mode 100644 legacy/doc/models/terminal-checkout.md create mode 100644 legacy/doc/models/terminal-refund-query-filter.md create mode 100644 legacy/doc/models/terminal-refund-query-sort.md create mode 100644 legacy/doc/models/terminal-refund-query.md create mode 100644 legacy/doc/models/terminal-refund.md create mode 100644 legacy/doc/models/test-webhook-subscription-request.md create mode 100644 legacy/doc/models/test-webhook-subscription-response.md create mode 100644 legacy/doc/models/time-range.md create mode 100644 legacy/doc/models/tip-settings.md create mode 100644 legacy/doc/models/transaction-product.md create mode 100644 legacy/doc/models/transaction-type.md create mode 100644 legacy/doc/models/transaction.md create mode 100644 legacy/doc/models/unlink-customer-from-gift-card-request.md create mode 100644 legacy/doc/models/unlink-customer-from-gift-card-response.md create mode 100644 legacy/doc/models/update-booking-custom-attribute-definition-request.md create mode 100644 legacy/doc/models/update-booking-custom-attribute-definition-response.md create mode 100644 legacy/doc/models/update-booking-request.md create mode 100644 legacy/doc/models/update-booking-response.md create mode 100644 legacy/doc/models/update-break-type-request.md create mode 100644 legacy/doc/models/update-break-type-response.md create mode 100644 legacy/doc/models/update-catalog-image-request.md create mode 100644 legacy/doc/models/update-catalog-image-response.md create mode 100644 legacy/doc/models/update-customer-custom-attribute-definition-request.md create mode 100644 legacy/doc/models/update-customer-custom-attribute-definition-response.md create mode 100644 legacy/doc/models/update-customer-group-request.md create mode 100644 legacy/doc/models/update-customer-group-response.md create mode 100644 legacy/doc/models/update-customer-request.md create mode 100644 legacy/doc/models/update-customer-response.md create mode 100644 legacy/doc/models/update-invoice-request.md create mode 100644 legacy/doc/models/update-invoice-response.md create mode 100644 legacy/doc/models/update-item-modifier-lists-request.md create mode 100644 legacy/doc/models/update-item-modifier-lists-response.md create mode 100644 legacy/doc/models/update-item-taxes-request.md create mode 100644 legacy/doc/models/update-item-taxes-response.md create mode 100644 legacy/doc/models/update-job-request.md create mode 100644 legacy/doc/models/update-job-response.md create mode 100644 legacy/doc/models/update-location-custom-attribute-definition-request.md create mode 100644 legacy/doc/models/update-location-custom-attribute-definition-response.md create mode 100644 legacy/doc/models/update-location-request.md create mode 100644 legacy/doc/models/update-location-response.md create mode 100644 legacy/doc/models/update-location-settings-request.md create mode 100644 legacy/doc/models/update-location-settings-response.md create mode 100644 legacy/doc/models/update-merchant-custom-attribute-definition-request.md create mode 100644 legacy/doc/models/update-merchant-custom-attribute-definition-response.md create mode 100644 legacy/doc/models/update-merchant-settings-request.md create mode 100644 legacy/doc/models/update-merchant-settings-response.md create mode 100644 legacy/doc/models/update-order-custom-attribute-definition-request.md create mode 100644 legacy/doc/models/update-order-custom-attribute-definition-response.md create mode 100644 legacy/doc/models/update-order-request.md create mode 100644 legacy/doc/models/update-order-response.md create mode 100644 legacy/doc/models/update-payment-link-request.md create mode 100644 legacy/doc/models/update-payment-link-response.md create mode 100644 legacy/doc/models/update-payment-request.md create mode 100644 legacy/doc/models/update-payment-response.md create mode 100644 legacy/doc/models/update-shift-request.md create mode 100644 legacy/doc/models/update-shift-response.md create mode 100644 legacy/doc/models/update-subscription-request.md create mode 100644 legacy/doc/models/update-subscription-response.md create mode 100644 legacy/doc/models/update-team-member-request.md create mode 100644 legacy/doc/models/update-team-member-response.md create mode 100644 legacy/doc/models/update-vendor-request.md create mode 100644 legacy/doc/models/update-vendor-response.md create mode 100644 legacy/doc/models/update-wage-setting-request.md create mode 100644 legacy/doc/models/update-wage-setting-response.md create mode 100644 legacy/doc/models/update-webhook-subscription-request.md create mode 100644 legacy/doc/models/update-webhook-subscription-response.md create mode 100644 legacy/doc/models/update-webhook-subscription-signature-key-request.md create mode 100644 legacy/doc/models/update-webhook-subscription-signature-key-response.md create mode 100644 legacy/doc/models/update-workweek-config-request.md create mode 100644 legacy/doc/models/update-workweek-config-response.md create mode 100644 legacy/doc/models/upsert-booking-custom-attribute-request.md create mode 100644 legacy/doc/models/upsert-booking-custom-attribute-response.md create mode 100644 legacy/doc/models/upsert-catalog-object-request.md create mode 100644 legacy/doc/models/upsert-catalog-object-response.md create mode 100644 legacy/doc/models/upsert-customer-custom-attribute-request.md create mode 100644 legacy/doc/models/upsert-customer-custom-attribute-response.md create mode 100644 legacy/doc/models/upsert-location-custom-attribute-request.md create mode 100644 legacy/doc/models/upsert-location-custom-attribute-response.md create mode 100644 legacy/doc/models/upsert-merchant-custom-attribute-request.md create mode 100644 legacy/doc/models/upsert-merchant-custom-attribute-response.md create mode 100644 legacy/doc/models/upsert-order-custom-attribute-request.md create mode 100644 legacy/doc/models/upsert-order-custom-attribute-response.md create mode 100644 legacy/doc/models/upsert-snippet-request.md create mode 100644 legacy/doc/models/upsert-snippet-response.md create mode 100644 legacy/doc/models/v1-device.md create mode 100644 legacy/doc/models/v1-list-orders-request.md create mode 100644 legacy/doc/models/v1-list-orders-response.md create mode 100644 legacy/doc/models/v1-money.md create mode 100644 legacy/doc/models/v1-order-history-entry-action.md create mode 100644 legacy/doc/models/v1-order-history-entry.md create mode 100644 legacy/doc/models/v1-order-state.md create mode 100644 legacy/doc/models/v1-order.md create mode 100644 legacy/doc/models/v1-phone-number.md create mode 100644 legacy/doc/models/v1-tender-card-brand.md create mode 100644 legacy/doc/models/v1-tender-entry-method.md create mode 100644 legacy/doc/models/v1-tender-type.md create mode 100644 legacy/doc/models/v1-tender.md create mode 100644 legacy/doc/models/v1-update-order-request-action.md create mode 100644 legacy/doc/models/v1-update-order-request.md create mode 100644 legacy/doc/models/vendor-contact.md create mode 100644 legacy/doc/models/vendor-status.md create mode 100644 legacy/doc/models/vendor.md create mode 100644 legacy/doc/models/visibility-filter.md create mode 100644 legacy/doc/models/void-transaction-response.md create mode 100644 legacy/doc/models/wage-setting.md create mode 100644 legacy/doc/models/webhook-subscription.md create mode 100644 legacy/doc/models/weekday.md create mode 100644 legacy/doc/models/workweek-config.md create mode 100644 legacy/exports/index.d.mts create mode 100644 legacy/exports/index.d.ts create mode 100644 legacy/exports/index.js create mode 100644 legacy/exports/index.mjs diff --git a/legacy/CHANGELOG.md b/legacy/CHANGELOG.md new file mode 100644 index 000000000..03990c0f4 --- /dev/null +++ b/legacy/CHANGELOG.md @@ -0,0 +1,618 @@ +# Change Log + +For general API and SDK changelogs, see [Square APIs and SDKs Release Notes](https://developer.squareup.com/docs/changelog/connect). + +## Version 17.0.0 (2021-12-15) +### API updates + +* **Invoices API:** + * The Invoices API now supports seller accounts in France. For more information, see [International availability and considerations.](https://developer.squareup.com/docs/invoices-api/overview#international-availability-invoices) + * France only: [`Invoice`](https://developer.squareup.com/reference/square_2021-12-15/objects/Invoice) object. Added a new `payment_conditions` field, which contains payment terms and conditions that are displayed on the invoice. This field is available only for sellers in France. For more information, see [Payment conditions.](https://developer.squareup.com/docs/invoices-api/overview#payment-conditions) + + Square version 2021-12-15 or higher is required to set this field, but it is returned in `ListInvoices` and `RetrieveInvoice` requests for all Square versions. + +* **Cards API** + * Added the `CARD_DECLINED_VERIFICATION_REQUIRED` error code to the list of error codes returned by [CreateCard](https://developer.squareup.com/reference/square_2021-12-15/cards-api/CreateCard). +* **Catalog API:** + * [CreateCatalogImage](https://developer.squareup.com/reference/square_2021-12-15/catalog-api/create-catalog-image) endpoint + * Updated to support attaching multiple images to a [Catalogbject](https://developer.squareup.com/reference/square_2021-12-15/objects/CatalogObject) instance. + * Added `is_primary` option to let the caller choose to attach an image as the primary image on the object for display with the Square Point of Sale and other first-party Square applications. For more information, see [Upload and Attach Images.](https://developer.squareup.com/docs/catalog-api/upload-and-attach-images) + * [CatalogObject](https://developer.squareup.com/reference/square_2021-12-15/objects/CatalogObject) object + * Retired the `image_id` field, used to hold a single image object attached to an image-supporting object of the `ITEM`, `ITEM_VARIATION`, `CATEGORY`, or `MODIFIER_LIST` type, in Square API version 2021-12-15 and later, which supports attachment of multiple images. The `image_id` field is still supported in Square API version prior to 2021-12-15. For more information, see [Work with Images: Overview.](https://developer.squareup.com/docs/catalog-api/cookbook/create-catalog-image#overview) + * [CatalogItem](https://developer.squareup.com/reference/square_2021-12-15/objects/CatalogItem), [CatalogItemVariation](https://developer.squareup.com/reference/square_2021-12-15/objects/CatalogItemVariation), [CatalogCategory](https://developer.squareup.com/reference/square_2021-12-15/objects/CatalogCategory) or [CatalogModifierList](https://developer.squareup.com/reference/square_2021-12-15/objects/CatalogModifierList) object + * Added `image_ids` list to hold attached image objects. The first element of `image_ids` list refers to the primary image attached to the catalog object. For more information, see [Work with Images: Overview.](https://developer.squareup.com/docs/catalog-api/cookbook/create-catalog-image#overview) + * [UpdateCatalogImage](https://developer.squareup.com/reference/square_2021-12-15/catalog-api/update-catalog-image) endpoint + * Added to support replacing the image file encapsulated by an existing [CatalogImage](https://developer.squareup.com/reference/square_2021-12-15/objects/CatalogImage) object. For more information, see [Replace image file on a CatalogImage object.](https://developer.squareup.com/docs/catalog-api/manage-images#replace-the-image-file-of-a-catalogimage-object) + + * [CatalogPricingRule](https://developer.squareup.com/reference/square_2021-12-15/objects/CatalogPricingRule) object + * Added [minimum_order_subtotal_money](https://developer.squareup.com/reference/square_2021-12-15/objects/CatalogPricingRule#definition__property-minimum_order_subtotal_money) field to require that the minimum order subtotal be reached before the pricing rule may be applied. + +### Documentation updates +* Added a new top-level node for Developer Tools. This node includes such features as Sandbox, API Logs, and Webhooks. +* Added [Webhook Event Logs (beta)](https://developer.squareup.com/docs/devtools/webhook-logs) documentation to the Developer Tools node. + + +## Version 16.0.0 (2021-11-17) +## API updates + +* **Cards API.** The [Card](https://developer.squareup.com/reference/square_2021-11-17/objects/card) object and webhook response body for all webhooks are updated updated with fields. + * Added the [Card.merchant_id](https://developer.squareup.com/reference/square_2021-11-17/objects/Card#definition__property-merchant_id) field to identify the Square seller that stored the payment card on file. + * Added a [Card](https://developer.squareup.com/reference/square_2021-11-17/objects/Card) object to the response bodies of all [Cards API webhooks](https://developer.squareup.com/docs/webhooks/v2webhook-events-tech-ref#cards-api). The `Card` is added as a child of the `data.object` field in all webhook responses. + +* **Bookings API.** The new [ListBookings](https://developer.squareup.com/reference/square_2021-11-17/bookings-api/list-bookings) endpoint supports browsing a collection of bookings of a seller. For more information, see [Use the Bookings API: list bookings.](https://developer.squareup.com/docs/bookings-api/use-the-api#list-bookings) + +* **Subscriptions API.** Introduced the new [actions framework](https://developer.squareup.com/docs/subscriptions-api/overview#subscriptions-actions-overview) representing scheduled, future changes to subscriptions. + * The new [PauseSubscription](https://developer.squareup.com/reference/square_2021-11-17/subscriptions-api/pause-subscription) endpoint supports temporarily pausing a subscription. Calling this endpoint schedules a new `PAUSE` action. + * The new [SwapPlan](https://developer.squareup.com/reference/square_2021-11-17/subscriptions-api/swap-plan) endpoint supports changing the subscription plan associated with a single customer. Calling this endpoint schedules a new `SWAP_PLAN` action. + * The new [DeleteSubscriptionAction](https://developer.squareup.com/reference/square_2021-11-17/subscriptions-api/delete-subscription-action) endpoint supports deleting a scheduled action. + * The [ResumeSubscription](https://developer.squareup.com/reference/square_2021-11-17/subscriptions-api/resume-subscription) endpoint has been updated to support resuming a paused subscription. Calling this endpoint schedules a new `RESUME` action. + * The [CancelSubscription](https://developer.squareup.com/reference/square_2021-11-17/subscriptions-api/cancel-subscription) endpoint now schedules a new `CANCEL` action. + * Added an optional `include` body parameter to the [SearchSubscriptions](https://developer.squareup.com/reference/square_2021-11-17/subscriptions-api/search-subscriptions) endpoint. Include `actions` in the request to return all [actions](https://developer.squareup.com/docs/subscriptions-api/overview#subscriptions-actions-overview) associated with the subscriptions. + +## Documentation Update + +* **Migration Guides.** + * [Migrate from the Connect V1 Refunds API.](https://developer.squareup.com/docs/migrate-from-v1/guides/v1-refunds) The topic is updated to include information to migrate from the v1 ListRefunds endpoint to the appropriate Square API counterparts. + * [Migrate from the Connect V1 Payments API.](https://developer.squareup.com/docs/migrate-from-v1/guides/v1-payments) The topic provides developers information to migrate from the Connect V1 Payments API to the appropriate Square API counterparts. + + Code that relies on these V1 API endpoints must be updated to avoid breaking when these APIs reach retirement. + + +## Version 15.0.0 (2021-10-20) +## API updates +* **Transactions API.** Three previously deprecated endpoints (`ListRefunds`, `Charge`, and `CreateRefund`) in the [Transactions API](https://developer.squareup.com/reference/square_2021-10-20/transactions-api) are removed from Square API version 2021-10-20 and later. These endpoints will work if you are using Square API versions prior to 2021-10-20. However, these endpoints will eventually be retired from all Square versions. + + * Instead of the Transactions API `Charge` endpoint, use the Payments API [CreatePayment](https://developer.squareup.com/reference/square_2021-10-20/payments-api/create-payment) endpoint. + * Instead of the Transactions API `CreateRefund` endpoint, use the Refunds API [RefundPayment](https://developer.squareup.com/reference/square_2021-10-20/payments-api/refund-payment) endpoint. + * Instead of the Transactions API `ListRefunds` endpoint, use the Refunds API [ListPaymentRefund](https://developer.squareup.com/reference/square_2021-10-20/payments-api/list-payment-refunds) endpoint. + +* **Payments API:** + * [Payment](https://developer.squareup.com/reference/square_2021-10-20/objects/Payment) object. + * Added the [device_details](https://developer.squareup.com/reference/square_2021-10-20/objects/Payment#definition__property-device_details) read-only field to view details of the device used to take a payment. This `Payment`-level field provides device information for all types of payments. Previously, device details were only available for card payments (`Payment.card_details.device_details`), which is now deprecated. + * Added the [team_member_id](https://developer.squareup.com/reference/square_2021-10-20/objects/Payment#definition__property-team_member_id) that applications can use to view the ID of the [TeamMember](https://developer.squareup.com/reference/square_2021-10-20/objects/TeamMember) associated with the payment. Use this field instead of the `Payment.employee_id` field, which is now deprecated. + * Added the [application_details](https://developer.squareup.com/reference/square_2021-10-20/objects/Payment#definition__property-application_details) read-only field to view details of the application that took the payment. + + * These `Payment` fields have moved to the [general availability](https://developer.squareup.com/docs/build-basics/api-lifecycle) (GA) state:[tip_money](https://developer.squareup.com/reference/square_2021-10-20/objects/Payment#definition__property-tip_money), [delay_duration](https://developer.squareup.com/reference/square_2021-10-20/objects/Payment#definition__property-delay_duration), [statement_description_identifier](https://developer.squareup.com/reference/square_2021-10-20/objects/Payment#definition__property-statement_description_identifier), [delay_duration](https://developer.squareup.com/reference/square_2021-10-20/objects/Payment#definition__property-delay_duration), [delay_action](https://developer.squareup.com/reference/square_2021-10-20/objects/Payment#definition__property-delay_action), [delayed_until](https://developer.squareup.com/reference/square_2021-10-20/objects/Payment#definition__property-delayed_until), and [statement_description_identifier](https://developer.squareup.com/reference/square_2021-10-20/objects/Payment#definition__property-statement_description_identifier). + + * The [ACH Bank Transfer Payments](https://developer.squareup.com/docs/payments-api/take-payments/ach-payments) feature has moved to the GA state. Accordingly, the [bank_account_details](https://developer.squareup.com/reference/square_2021-10-20/objects/Payment#definition__property-bank_account_details) field (and its [BankAccountPaymentDetails](https://developer.squareup.com/reference/square_2021-10-20/objects/BankAccountPaymentDetails) type) are moved to the GA state. + * [CreatePayment](https://developer.squareup.com/reference/square_2021-10-20/payments-api/create-payment) endpoint. + * Added the [team_member_id](https://developer.squareup.com/reference/square_2021-10-20/payments-api/create-payment#request__property-team_member_id) request field to record the ID of the team member associated with the payment. + * The [accept_partial_authorization](https://developer.squareup.com/reference/square_2021-10-20/payments-api/create-payment#request__property-accept_partial_authorization) request field has moved to the GA state. + * [CompletePayment](https://developer.squareup.com/reference/square_2021-10-20/payments-api/complete-payment) endpoint. Added the `version_token` request field to support optimistic concurrency. For more information, see [Delayed capture of a card payment.](https://developer.squareup.com/docs/payments-api/take-payments/card-payments#delayed-capture-of-a-card-payment) + +* **Refunds API:** + * [RefundPayment](https://developer.squareup.com/reference/square_2021-10-20/refunds-api/refund-payment) endpoint. + * Added the `team_member_id` request field to record the ID of the team member associated with the refund. + * Added the `payment_version_token` request field to support optimistic concurrency. For more information, see [Refund Payment.](https://developer.squareup.com/docs/payments-api/refund-payments#optimistic-concurrency) + +* **Customers API:** + * [Customer](https://developer.squareup.com/reference/square_2021-10-20/objects/Customer) object. Added a new `tax_ids` field of the [CustomerTaxIds](https://developer.squareup.com/reference/square_2021-10-20/objects/CustomerTaxIds) type, which can contain the EU VAT ID of the customer. This field is available only for customers of sellers in France, Ireland, or the United Kingdom. For more information, see [Customer tax IDs.](https://developer.squareup.com/docs/customers-api/what-it-does#customer-tax-ids) + + * [UpdateCustomer](https://developer.squareup.com/reference/square_2021-10-20/customers-api/update-customer) endpoint. The Customers API now returns a `400 BAD_REQUEST` error if the request body does not contain any fields. For earlier Square versions, the Customers API will continue to return a `200 OK` response along with the customer profile. For more information, see [Migration notes.](https://developer.squareup.com/docs/customers-api/what-it-does#migration-notes) + +* **Invoices API:** + * [InvoiceRecipient](https://developer.squareup.com/reference/square_2021-10-20/objects/InvoiceRecipient) object. Added a new, read-only `tax_ids` field of the [InvoiceRecipientTaxIds](https://developer.squareup.com/reference/square_2021-10-20/objects/InvoiceRecipientTaxIds) type, which can contain the EU VAT ID of the invoice recipient. This field is available only for customers of sellers in Ireland or the United Kingdom. If defined, `tax_ids` is returned for all Square API versions. For more information, see [Invoice recipient tax IDs.](https://developer.squareup.com/docs/invoices-api/overview#recipient-tax-ids) + * Square now sends emails for test invoices that are published in the Sandbox environment. + +* **Catalog API:** + * [CatalogSubscriptionPlan.name](https://developer.squareup.com/reference/square_2021-10-20/objects/CatalogSubscriptionPlan#definition__property-name) can be updated after the subscription plan is created. The change is retroactively applicable to prior versions of the Square API. + +* **Subscriptions API:** + * The new [SubscriptionSource](https://developer.squareup.com/reference/square_2021-10-20/objects/SubscriptionSource) data type is introduced to encapsulate the source where a subscription is created. The new `SubscriptionSource.name` value is propagated to the `Order.source` attribute when an order is made on the subscription. The new feature is retroactively applicable to prior versions of the Square API. + * The new [Subscription.source](https://developer.squareup.com/reference/square_2021-10-20/objects/Subscription#definition__property-source) attribute is introduced to indicate the source where the subscription was created. This new feature is retroactively applicable to prior versions of the Square API. + * The new [SearchSubscriptionsFilter.source_names](https://developer.squareup.com/reference/square_2021-10-20/objects/SearchSubscriptionFilter#definition__property-source_names) query expression is introduced to enable search for subscriptions by the subscription source name. This new feature is retroactively applicable to prior versions of the Square API. + + +## Version 14.1.0 (2021-09-15) +## API updates + +* **Invoices API:** + * [Invoice](https://developer.squareup.com/reference/square_2021-09-15/objects/Invoice) object. Added a new, optional `sale_or_service_date` field used to specify the date of the sale or the date that the service is rendered. If specified, this date is displayed on the invoice. + +* **Orders API:** + * [CreateOrder](https://developer.squareup.com/reference/square_2021-09-15/orders-api/create-order). The endpoint now supports creating temporary, draft orders. For more information, see [Create a draft order.](https://developer.squareup.com/docs/orders-api/create-orders#create-a-draft-order) + * [CloneOrder](https://developer.squareup.com/reference/square_2021-09-15/orders-api/clone-order). The Orders API supports this new endpoint to clone an existing order. For more information, see [Clone an order.](https://developer.squareup.com/docs/orders-api/create-orders#clone-an-order) + * These fields have moved to the [general availability (GA)](https://developer.squareup.com/docs/build-basics/api-lifecycle#general-availability) state: [OrderLineItem.item_type](https://developer.squareup.com/reference/square_2021-09-15/objects/OrderLineItem#definition__property-item_type), [OrderServiceCharge.type](https://developer.squareup.com/reference/square_2021-09-15/objects/OrderServiceCharge#definition__property-type), and `catalog_version` field on every order type that contains this field. + +* **Team API:** + * [SearchTeamMembersFilter](https://developer.squareup.com/reference/square_2021-09-15/objects/SearchTeamMembersFilter) object now has an `is_owner` field that when set, causes a team member search to return only the seller who owns a Square account. + +* **Terminal API:** + * [TerminalCheckout](https://developer.squareup.com/reference/square_2021-09-15/objects/TerminalCheckout) object. The `customer_id` field is now GA. + +## Documentation updates +* **OAuth API:** + * Revised API descriptions for the ObtainToken and Authorize endpoints. Clarified that the Authorize endpoint is not a callable API but is used to direct the seller to the Square authorization page. For more information about the Authorize endpoint, see [Create the Redirect URL and Square Authorization Page URL.](https://developer.squareup.com/docs/oauth-api/create-urls-for-square-authorization) + + +## Version 13.1.0 (2021-08-18) +## API updates + +* **Customers API:** + * [Customer](https://developer.squareup.com/reference/square_2021-08-18/objects/Customer) object. The `version` field has moved to the [general availability](https://developer.squareup.com/docs/build-basics/api-lifecycle#general-availability) (GA) state. This field represents the current version of the customer profile and enables optimistic concurrency control. For more information, see [Customer profile versions and optimistic concurrency support.](https://developer.squareup.com/docs/customers-api/what-it-does#customer-profile-versions-and-optimistic-concurrency-support) + * [ListCustomers](https://developer.squareup.com/reference/square_2021-08-18/customers-api/list-customers) endpoint. The new, optional `limit` query parameter can be used to specify the maximum number of results in a paginated response. + +* **Customer Groups API:** + * [ListCustomerGroups](https://developer.squareup.com/reference/square_2021-08-18/customer-groups-api/list-customer-groups) endpoint. The new, optional `limit` query parameter can be used to specify the maximum number of results in a paginated response. + +* **Customer Segments API:** + * [ListCustomerSegments](https://developer.squareup.com/reference/square_2021-08-18/customer-segments-api/list-customer-segments) endpoint. The new, optional `limit` query parameter can be used to specify the maximum number of results in a paginated response. + +* **Invoices API:** + * Square Invoices Plus is a monthly subscription plan that allows access to premium invoice features. After Invoices Plus is launched in September 2021, a subscription will be required to create invoices with custom fields and installment payments. For more information, including how to handle new errors, see [Premium features available with Invoices Plus.](https://developer.squareup.com/docs/invoices-api/overview#invoices-plus-subscription) + +* **Loyalty API:** + * [LoyaltyAccount](https://developer.squareup.com/reference/square_2021-08-18/objects/LoyaltyAccount) object. Added a new `expiring_point_deadlines` field that specifies when points in the account balance are scheduled to expire. This field contains a list of [LoyaltyAccountExpiringPointDeadline](https://developer.squareup.com/reference/square_2021-08-18/objects/LoyaltyAccountExpiringPointDeadline) objects. For more information, see [Expiring points.](https://developer.squareup.com/docs/loyalty-api/overview#expiring-points) + +## Documentation updates + +* [App Marketplace.](https://developer.squareup.com/docs/app-marketplace) Added the following topics: + * [How to apply.](https://developer.squareup.com/docs/app-marketplace#how-to-apply) Documented the process to list an application on the Square App Marketplace. + * [App Marketplace API Usage Requirements.](https://developer.squareup.com/docs/app-marketplace/requirements) Added a topic that describes a set of API usage requirements and recommendations for partner applications. + +* [Automatic communications from Square about invoices.](https://developer.squareup.com/docs/invoices-api/overview#automatic-communication-from-square-to-customers) Documented the invoice-related communications sent from Square to customers and sellers. + +* [Snippets best practices.](https://developer.squareup.com/docs/snippets-api/overview#best-practices) Documented best practices and additional requirements for snippets and applications that integrate with the Snippets API. + + +## Version 13.0.0 (2021-07-21) +## API updates + +* **Orders API:** + * [OrderServiceCharge](https://developer.squareup.com/reference/square_2021-07-21/objects/OrderServiceCharge) object. Added a new field, `type`. It identifies the service charge type. + + * [OrderQuantityUnit](https://developer.squareup.com/reference/square_2021-07-21/objects/OrderQuantityUnit), + [OrderLineItem](https://developer.squareup.com/reference/square_2021-07-21/objects/OrderLineItem), + [OrderLineItemDiscount](https://developer.squareup.com/reference/square_2021-07-21/objects/OrderLineItemDiscount), + [OrderLineItemModifier](https://developer.squareup.com/reference/square_2021-07-21/objects/OrderLineItemModifier), + [OrderLineItemTax](https://developer.squareup.com/reference/square_2021-07-21/objects/OrderLineItemTax), + [OrderServiceCharge](https://developer.squareup.com/reference/square_2021-07-21/objects/OrderServiceCharge), + [OrderReturnLineItem](https://developer.squareup.com/reference/square_2021-07-21/objects/OrderReturnLineItem), + [OrderReturnLineItemModifier](https://developer.squareup.com/reference/square_2021-07-21/objects/OrderReturnLineItemModifier), + [OrderReturnServiceCharge](https://developer.squareup.com/reference/square_2021-07-21/objects/OrderReturnServiceCharge), + [OrderReturnTax](https://developer.squareup.com/reference/square_2021-07-21/objects/OrderReturnTax), and + [OrderReturnDiscount](https://developer.squareup.com/reference/square_2021-07-21/objects/OrderReturnDiscount) objects. Added a new field, `catalog_version`. +* **Locations API:** + * [Location](https://developer.squareup.com/reference/square_2021-07-21/objects/Location) object. Added a new field `tax_ids` of type `TaxIds`. In the current implementation, sellers in Ireland and France can configure tax IDs during the onboarding process. They can also provide the information later by updating the location information in the Seller Dashboard. These tax IDs appear in this field. + +* **Loyalty API:** + * As of July 15, 2021, the country in which the seller’s Square account is activated determines whether Square uses pretax or post-tax purchase amounts to calculate accrued points. This change supports consumption tax models, such as value-added tax (VAT). Previously, point accrual was based on pretax purchase amounts only. This change does not affect the existing point balance of loyalty accounts. For more information, see [Availability of Square Loyalty.](https://developer.squareup.com/docs/loyalty-api/overview#loyalty-market-availability) + +* **Payments API:** + * [UpdatePayment](https://developer.squareup.com/reference/square_2021-07-21/payments-api/update-payment). The endpoint has moved to the [general availability](https://developer.squareup.com/docs/build-basics/api-lifecycle#general-availability) (GA) state. Also, you can now update gift card payments (similar to card, cash, and external payments). + +* **Subscriptions API:** + * The [Subscriptions API](https://developer.squareup.com/docs/subscriptions-api/overview) has moved to the [general availability](https://developer.squareup.com/docs/build-basics/api-lifecycle#general-availability) (GA) state. + * [CatalogSubscriptionPlan](https://developer.squareup.com/reference/square_2021-07-21/objects/CatalogSubscriptionPlan) object. The `name` and `price` are now write-once fields. You specify these values at the time of creating a plan. After the plan is created, these fields cannot be updated. This makes a subscription plan immutable. + +* **Inventory API:** + * [RetrieveInventoryTransfer.](https://developer.squareup.com/reference/square_2021-07-21/inventory-api/Retrieve-Inventory-Transfer) This new endpoint is introduced to support the retrieval of inventory transfer. + * [RetrieveInventoryChanges.](https://developer.squareup.com/reference/square_2021-07-21/inventory-api/Retrieve-Inventory-Changes) This endpoint is deprecated. Its support ends when it is retired in about 12 months. + * The following endpoints have updated URLs to conform to the standard REST API convention. For more information about migrating deprecated URLs to updated URLs in your application, see [Inventory API: Migrate to Updated API Entities.](https://developer.squareup.com/docs/inventory-api/migrate-to-updated-api-entities) + * [RetrieveInventoryAdjustment](https://developer.squareup.com/reference/square_2021-07-21/inventory-api/Retrieve-Inventory-Adjustment) + * [BatchChangeInventory](https://developer.squareup.com/reference/square_2021-07-21/inventory-api/Batch-Change-Inventory) + * [BatchRetrieveInventoryChanges](https://developer.squareup.com/reference/square_2021-07-21/inventory-api/Batch-Retrieve-Inventory-Changes) + * [BatchRetrieveInventoryCounts](https://developer.squareup.com/reference/square_2021-07-21/inventory-api/Batch-Retrieve-Inventory-Counts) + * [RetrieveInventoryPhysicalCount](https://developer.squareup.com/reference/square_2021-07-21/inventory-api/Retrieve-Inventory-Physical-Count) + +## Documentation updates +* **Webhooks.** Revised the steps and descriptions for creating and using webhooks. For more information, see [Webhooks Overview.](https://developer.squareup.com/docs/webhooks/overview) + + +## Version 12.0.0 (2021-06-16) +## New API releases +* **Gift Cards API and Gift Card Activities API.** Gift card support is integrated in the [Square Seller Dashboard](https://squareup.com/dashboard/) and the [Square Point of Sale](https://squareup.com/us/en/point-of-sale) application. Sellers can sell, redeem, track, and reload Square gift cards. Now developers can use the [Gift Cards API](https://developer.squareup.com/reference/square_2021-06-16/gift-cards-api) and the [Gift Card Activities API](https://developer.squareup.com/reference/square_2021-06-16/gift-card-activities-api) to integrate Square gift cards into third-party applications. For more information, see [Gift Cards API Overview.](https://developer.squareup.com/docs/gift-cards/using-gift-cards-api) + +* **Cards API.** The [Cards API](https://developer.squareup.com/reference/square_2021-06-16/cards-api) replaces the deprecated `CreateCustomerCard` and `DeleteCustomerCard` endpoints and lets an application save a customer payment card on file along with other card management operations. For more information, see [Cards API Overview.](https://developer.squareup.com/docs/cards-api/overview) + +## API updates +* **Catalog API:** + * [CatalogPricingRule](https://developer.squareup.com/reference/square_2021-06-16/objects/CatalogPricingRule). Support of the [customer group discount](https://developer.squareup.com/reference/square_2021-06-16/objects/CatalogPricingRule#definition__property-customer_group_ids_any) becomes GA. For more information, see [CreateCustomerGroupDiscounts.](https://developer.squareup.com/docs/catalog-api/configure-customer-group-discounts) + * [CatalogItemVariation](https://developer.squareup.com/reference/square_2021-06-16/objects/CatalogItemVariation). Offers Beta support of the [stockable](https://developer.squareup.com/reference/square_2021-06-16/objects/CatalogItemVariation#definition__property-stockable) and [stockable_conversion](https://developer.squareup.com/reference/square_2021-06-16/objects/CatalogItemVariation#definition__property-stockable_conversion) attributes to enable sales of a product in multiple measurement units. + * [UpsertCatalogObject](https://developer.squareup.com/reference/square_2021-06-16/catalog-api/upsert-catalog-object) and [BatchUpsertCatalogObjects](https://developer.squareup.com/reference/square_2021-06-16/catalog-api/batch-upsert-catalog-objects). Support creating an item with stockable and non-stockable variations with a specified stock conversion between the two. For more information, see [Enable Stock Conversion.](https://developer.squareup.com/docs/inventory-api/enable-stock-conversion) + * [UpsertCatalogObject](https://developer.squareup.com/reference/square_2021-06-16/catalog-api/upsert-catalog-object) and [BatchUpsertCatalogObjects](https://developer.squareup.com/reference/square_2021-06-16/catalog-api/batch-upsert-catalog-objects). Require that an item be created with at least one variation. Otherwise, an `INVALID_REQUEST` error is returned. + +* **Customers API:** + * Using the Customers API to manage cards on file is deprecated: + * The [CreateCustomerCard](https://developer.squareup.com/reference/square_2021-06-16/customers-api/create-customer-card) endpoint is deprecated and replaced by the [CreateCard](https://developer.squareup.com/reference/square_2021-06-16/cards-api/create-card) and [LinkCustomerToGiftCard](https://developer.squareup.com/reference/square_2021-06-16/gift-cards-api/link-customer-to-gift-card) endpoints. + * The [DeleteCustomerCard](https://developer.squareup.com/reference/square_2021-06-16/customers-api/delete-customer-card) endpoint is deprecated and replaced by the [DisableCard](https://developer.squareup.com/reference/square_2021-06-16/cards-api/disable-card) and [UnlinkCustomerFromGiftCard](https://developer.squareup.com/reference/square_2021-06-16/gift-cards-api/unlink-customer-from-gift-card) endpoints. + * The `cards` field in the [Customer](https://developer.squareup.com/reference/square_2021-06-16/objects/Customer) object is deprecated and replaced by the following endpoints: + * [ListCards](https://developer.squareup.com/reference/square_2021-06-16/cards-api/list-cards) to retrieve credit and debit cards on file. + * [ListGiftCards](https://developer.squareup.com/reference/square_2021-06-16/gift-cards-api/list-gift-cards) to retrieve gift cards on file. + + For more information, see [Migrate to the Cards API and Gift Cards API.](https://developer.squareup.com/docs/customers-api/use-the-api/integrate-with-other-services#migrate-customer-cards) + + * [Customer](https://developer.squareup.com/reference/square_2021-06-16/objects/Customer) object. In the `cards` field, the IDs for gift cards now have a `gftc:` prefix followed by the card number. This is a service-level change that applies to all Square API versions. + +* **Disputes API:** + * The Disputes API is now GA. + * `RemoveDisputeEvidence`. Renamed to [DeleteDisputeEvidence](https://developer.squareup.com/reference/square_2021-06-16/objects/DeleteDisputeEvidence). + * [CreateDisputeEvidenceFile.](https://developer.squareup.com/reference/square_2021-06-16/objects/CreateDisputeEvidenceFile) The URL is changed from `/v2/disputes/{dispute_id}/evidence_file` to `/v2/disputes/{dispute_id}/evidence-files`. + * [CreateDisputeEvidenceText.](https://developer.squareup.com/reference/square_2021-06-16/objects/CreateDisputeEvidenceText) The URL is changed from `/v2/disputes/{dispute_id}/evidence_text` to `/v2/disputes/{dispute_id}/evidence-text`. + * [ListDisputeEvidence.](https://developer.squareup.com/reference/square_2021-06-16/objects/ListDisputeEvidence) The endpoint now returns a pagination cursor and accepts a pagination cursor in requests. + * `DISPUTES_READ` and `DISPUTES_WRITE` permissions are required for all Disputes API endpoints instead of `PAYMENTS_READ` and `PAYMENTS_WRITE`. + * [DisputeEvidence.](https://developer.squareup.com/reference/square_2021-06-16/objects/DisputeEvidence) The `evidence_id` field is deprecated and replaced by the `id` field. + * The `dispute.state.changed` webhook is renamed to `dispute.state.updated`. + * [Dispute](https://developer.squareup.com/reference/square_2021-06-16/objects/Dispute) object. The following breaking changes are made: + * The `dispute_id` field is deprecated and replaced by the `id` field. + * The `reported_date` field is deprecated and replaced by the `reported_at` field. + * The `evidence_ids` field is deprecated with no replacement. + + For more information about the GA release of the Disputes API, see [Disputes Overview.](https://developer.squareup.com/docs/disputes-api/overview) + + +* **Inventory API:** + * [CatalogStockConversion](https://developer.squareup.com/docs/{SQUARE_TECH_REF}/objects/CatalogStockConversion) (Beta). Enables selling a product in multiple measurement units and lets Square sellers manage inventory counts of the product's stockable and a non-stockable variations in a self-consistent manner. For more information, see [Enable Stock Conversion.](https://developer.squareup.com/docs/inventory-api/enable-stock-conversion) + +* **Invoices API:** + * [CreateInvoice.](https://developer.squareup.com/reference/square_2021-06-16/invoices-api/create-invoice) The `location_id` field is now optional and defaults to the location ID of the associated order. If specified in the request, the value must match the location ID of the associated order. This is a service-level change that applies to all Square API versions. + +* **Loyalty API:** + * [LoyaltyProgramAccrualRule](https://developer.squareup.com/reference/square_2021-06-16/objects/LoyaltyProgramAccrualRule) object. New `excluded_category_ids` and `excluded_item_variation_ids` fields that represent any categories and items that are excluded from accruing points in spend-based loyalty programs. + +* **Subscriptions API:** + * [Subscription.](https://developer.squareup.com/reference/square_2021-06-16/objects/Subscription) The `paid_until_date` field is renamed to `charge_through_date`. + * [UpdateSubscription.](https://developer.squareup.com/reference/square_2021-06-16/subscriptions-api/update-subscription) The `version` field is now optional because it can update only the latest version of a subscription. + + * [CreateSubscription.](https://developer.squareup.com/reference/square_2021-06-16/subscriptions-api/create-subscription) The `idempotency_key` field is now optional in the request. If you do not provide it, each `CreateSubscription` assumes a unique (never used before) value and creates a subscription for each call. + +## Documentation updates +* [Order fee structure.](https://developer.squareup.com/docs/payments-pricing#orders-api-fee-structure) Documented the transaction fee related to using the Orders API with a non-Square payments provider. + + +## Version 11.0.0 (2021-05-13) +## New API releases + +* **Sites API.** The [Sites API](https://developer.squareup.com/reference/square_2021-05-13/sites-api) lets you retrieve basic details about the Square Online sites that belong to a Square seller. For more information, see [Sites API Overview.](https://developer.squareup.com/docs/sites-api/overview) + + +* **Snippets API.** The [Snippets API](https://developer.squareup.com/reference/square_2021-05-13/snippets-api) lets you manage snippets that provide custom functionality on Square Online sites. A snippet is a script that is injected into all pages on a site, except for checkout pages. For more information, see [Snippets API Overview.](https://developer.squareup.com/docs/snippets-api/overview) + +The Sites API and Snippets API are publicly available to all developers as part of an early access program (EAP). 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) + +## API updates + +* **Payments API.** + * [CreatePayment.](https://developer.squareup.com/reference/square_2021-05-13/payments-api/create-payment) The endpoint now supports ACH bank transfer payments. For more information, see [ACH Payment](https://developer.squareup.com/docs/payments-api/take-payments/ach-payments). + +* **Loyalty API:** + * The [Loyalty API](https://developer.squareup.com/docs/loyalty-api/overview) has moved to the [general availability](https://developer.squareup.com/docs/build-basics/api-lifecycle#general-availability) (GA) state. + + * The [ListLoyaltyPrograms](https://developer.squareup.com/reference/square_2021-05-13/loyalty-api/list-loyalty-programs) endpoint is deprecated and replaced by the [RetrieveLoyaltyProgram](https://developer.squareup.com/reference/square_2021-05-13/loyalty-api/retrieve-loyalty-program) endpoint when used with the `main` keyword. + + * [LoyaltyAccount](https://developer.squareup.com/reference/square_2021-05-13/objects/LoyaltyAccount)  object. The `mappings` field is retired and replaced by `mapping`. + + * [LoyaltyAccountMapping](https://developer.squareup.com/reference/square_2021-05-13/objects/LoyaltyAccountMapping) object. The `type` and `value` fields are retired and replaced by `phone_number`. + + Starting in Square version 2021-05-13: + * `mappings` is not accepted in `CreateLoyaltyAccount` requests or returned in responses. + * `type` and `value` are not accepted in `CreateLoyaltyAccount` or `SearchLoyaltyAccounts` requests or returned in responses. + + For more information, see [Migration notes.](https://developer.squareup.com/docs/loyalty-api/overview#migration-notes) + +## Documentation updates +* **Getting Started** Added step that shows how to use the API Logs to examine a transaction. + + +## Version 10.0.0 (2021-04-21) +## New API releases + +## Existing API updates + +* **Subscriptions API:** + * [ResumeSubscription.](https://developer.squareup.com/reference/square_2021-04-21/subscriptions-api/resume-subscription) This new endpoint enables applications to resume [deactivated subscriptions.](https://developer.squareup.com/docs/subscriptions-api/overview#deactivated-subscriptions) After a subscription is created, there are events that can make a subscription non-billable, causing Square to deactivate the subscription. A seller can also resume deactivated subscriptions in the Seller Dashboard. Applications can call [ListSubscriptionEvents](https://developer.squareup.com/reference/square_2021-04-21/subscriptions-api/list-subscription-events) to determine why Square deactivated a subscription. + +* **Customers API:** + + * [Customer](https://developer.squareup.com/reference/square_2021-04-21/objects/Customer) object: + * New `version` field (beta). This field represents the current version of the customer profile. You can include it in your `UpdateCustomer` and `DeleteCustomer` requests to enable optimistic concurrency. For more information, see [Customer profile versions and optimistic concurrency support.](https://developer.squareup.com/docs/customers-api/what-it-does#customer-profile-versions-and-optimistic-concurrency-support) + * The `groups` field and corresponding `CustomerGroupInfo` object are retired. + + * [Customer webhooks](https://developer.squareup.com/docs/customers-api/use-the-api/customer-webhooks) have moved to the [general availability](https://developer.squareup.com/docs/build-basics/api-lifecycle#general-availability) (GA) state. Event notifications now include the `version` field (beta). + +* **Invoices API:** + + * The [Invoices API](https://developer.squareup.com/docs/invoices-api/overview) has moved to the GA state. + + * [Invoice](https://developer.squareup.com/reference/square_2021-04-21/objects/Invoice) object: + * A new required `accepted_payment_methods` field that defines the methods of payment that customers can use to pay an invoice on the Square-hosted invoice page. Valid values are defined in the new [InvoiceAcceptedPaymentMethods](https://developer.squareup.com/reference/square_2021-04-21/objects/InvoiceAcceptedPaymentMethods) enum. For more information, see the [migration notes.](https://developer.squareup.com/docs/invoices-api/overview#migration-notes) + * A new `subscription_id` field, which is included in invoices created for subscription billing. + +* **Loyalty API:** (beta) + + * [RetrieveLoyaltyProgram](https://developer.squareup.com/reference/square_2021-04-21/loyalty-api/retrieve-loyalty-program) endpoint. This new endpoint accepts a program ID or the `main` keyword and returns the loyalty program in a seller's account. For more information, see [Retrieve a loyalty program.](https://developer.squareup.com/docs/loyalty-api/overview#retrieve-loyalty-program) This endpoint is preferred over the `ListLoyaltyPrograms` endpoint. + + * Introduced a new mapping implementation for loyalty accounts: + * [LoyaltyAccount](https://developer.squareup.com/reference/square_2021-04-21/objects/LoyaltyAccount) object. Added the `mapping` field (of type `LoyaltyAccountMapping`), which is used to associate the loyalty account with a buyer. This field is recommended over the `mappings` field. + * [LoyaltyAccountMapping](https://developer.squareup.com/reference/square_2021-04-21/objects/LoyaltyAccountMapping) object. Added the `phone_number` field to represent a phone number mapping. This field is recommended over the `type` and `value` fields. + + * A new [loyalty.program.created](https://developer.squareup.com/reference/square_2021-04-21/webhooks/loyalty.program.created) webhook. Square now publishes an event notification when a loyalty program is created in the Square Seller Dashboard. + +* **Inventory API:** + * [InventoryChange](https://developer.squareup.com/reference/square_2021-04-21/objects/InventoryChange) can now have its own measurement unit. + +* **Catalog API:** + * [CatalogItem](https://developer.squareup.com/reference/square_2021-04-21/objects/CatalogItem) introduces the `sort_name` attribute that can take Japanese writing scripts to sort items by. When it is unspecified, the regular `name` attribute is used for sorting. + * [CatalogPricingRule](https://developer.squareup.com/reference/square_2021-04-21/objects/CatalogCatalogPricingRule) has the new `customer_group_ids_any` attribute included to support automatic application of discounts to specified product set purchased by members of any of the customer groups identified by the `customer_group_ids_any` attribute values. +* **Team API** + * New [Team webhooks](https://developer.squareup.com/reference/square_2021-04-21/team-api/webhooks): `team_member.created`, `team_member.updated`, `team_member.wage_setting.updated` to notify on created and updated team members and wage settings. + +## SDKs +* **Connect Node.js SDK:** (retired) + * The Connect Node.js SDK is retired and replaced by the [Square Node.js SDK.](https://github.com/square/square-nodejs-sdk) For migration information, see [Connect Node.js SDK README.](https://github.com/square/connect-nodejs-sdk/blob/master/README.md) + + + + +## Version 9.1.0 (2021-03-17) + +## Existing API updates + +* **Payments API:** + * [CreatePayment](https://developer.squareup.com/reference/square_2021-03-17/payments-api/create-payment). Until now, the `CreatePayment` endpoint supported only taking card payments. In this release, the API now supports cash and external payments. For more information, see [Take Payments.](https://developer.squareup.com/docs/payments-api/take-payments) + * [UpdatePayment](https://developer.squareup.com/reference/square_2021-03-17/payments-api/update-payment). This new endpoint enables developers to change the payment amount and tip amount after a payment is created. For more information, see [Update Payments.](https://developer.squareup.com/docs/payments-api/update-payments) + +* **Invoices API:** + * [InvoiceDeliveryMethod](https://developer.squareup.com/reference/square_2021-03-17/enums/InvoiceDeliveryMethod) enum. Added the read-only `SMS` value. + * [InvoiceRequestMethod](https://developer.squareup.com/reference/square_2021-03-17/enums/InvoiceRequestMethod) enum (deprecated). Added the read-only `SMS`, `SMS_CHARGE_CARD_ON_FILE`, and `SMS_CHARGE_BANK_ON_FILE` values for backward compatibility. + + These values direct Square to send invoices and receipts to customers using SMS (text message). SMS settings can be configured from first-party Square applications only; they cannot be configured from the Invoices API. Square does not send invoice reminders when using SMS to communicate with customers. + + +* **Terminal API:** + * [TerminalCheckout](https://developer.squareup.com/reference/square_2021-03-17/objects/TerminalCheckout). Previously, `TerminalCheckout` only supported tapped, dipped, or swiped credit cards. It now supports manual card entry and e-money. Added the `payment_type` field to denote a request for a manually entered payment card or an e-money payment. + * [TerminalCheckoutPaymentType.](https://developer.squareup.com/reference/square_2021-03-17enums/TerminalCheckoutPaymentType) A new enum for the Terminal checkout payment types that can be requested. + * [E-money support](https://developer.squareup.com/docs/terminal-api/e-money-payments) is now available for Terminal checkout requests in Japan. + + +## SDKs +* **Square Java SDK:** + * Updated the OkHttp dependency to version 4.9.0. + * Fixed a `NullPointerException` when passing an empty order ID to the `UpdateOrder` method. + +## Documentation updates + +* **Multi-language code examples.** Previously, various topics showed only cURL examples for the REST API operations. These topics now show examples in multiple languages. You can use the language drop-down list to choose a language. + +* [When to Use Connect V1.](https://developer.squareup.com/docs/build-basics/using-connect-v1) Content is revised to reflect the most current information about when to use the Connect V1 API. + + +## Version 9.0.0 (2021-02-26) +## Existing API updates + +* **Customers API:** + + * [New webhooks](https://developer.squareup.com/docs/customers-api/use-the-api/customer-webhooks) (beta). Square now sends notifications for the following events: + * [customer.created](https://developer.squareup.com/reference/square_2021-02-26/webhooks/customer.created) + * [customer.deleted](https://developer.squareup.com/reference/square_2021-02-26/webhooks/customer.deleted) + * [customer.updated](https://developer.squareup.com/reference/square_2021-02-26/webhooks/customer.updated) + +* **Orders API:** + * [CreateOrder](https://developer.squareup.com/reference/square_2021-02-26/orders-api/create-order). Removed the `location_id` field from the request. It was an unused field. + +* **Payments API:** + * [Payment](https://developer.squareup.com/reference/square_2021-02-26/objects/Payment). This type now returns the `card_payment_timeline` [(CardPaymentTimeline](https://developer.squareup.com/reference/square_2021-02-26/objects/CardPaymentTimeline)) as part of the `card_details` field. + +* **v1 Items API:** + * The following endpoints are [retired:](https://developer.squareup.com/docs/build-basics/api-lifecycle) + * `AdjustInventory`: Use the Square Inventory API [BatchChangeInventory](https://developer.squareup.com/reference/square_2021-02-26/inventory-api/batch-change-inventory) endpoint. + * `ListInventory`: Use the Square Inventory API [BatchRetrieveInventoryCounts](https://developer.squareup.com/reference/square_2021-02-26/inventory-api/batch-retrieve-inventory-counts) endpoint. + +* **v1 Employees.Timecards:** + * The following endpoints are retired: + * `CreateTimecard`: Use the Square Labor API [CreateShift](https://developer.squareup.com/reference/square_2021-02-26/labor-api/create-shift) endpoint. + * `DeleteTimecard`: Use the Square Labor API [DeleteShift](https://developer.squareup.com/reference/square_2021-02-26/labor-api/delete-shift) endpoint. + * `ListTimecards`: Use the Square Labor API [SearchShift](https://developer.squareup.com/reference/square_2021-02-26/labor-api/search-shift) endpoint. + * `RetrieveTimecards`: Use the Square Labor API [GetShift](https://developer.squareup.com/reference/square_2021-02-26/labor-api/get-shift) endpoint. + * `UpdateTimecard`: Use the Square Labor API [UpdateShift](https://developer.squareup.com/reference/square_2021-02-26/labor-api/update-shift) endpoint. + * `ListTimecardEvents`: No direct replacement. To learn about replacing the v1 functionality, see the [migration guide.](https://developer.squareup.com/docs/migrate-from-v1/guides/v1-timecards#endpoints) + +* **v1 Employees.CashDrawers:** + * The following endpoints are retired: + * `ListCashDrawerShifts`: Use the Square CashDrawerShifts API [ListCashDrawerShifts](https://developer.squareup.com/reference/square_2021-02-26/cash-drawers-api/list-cash-drawer-shifts) endpoint. + * `RetrieveCashDrawerShift`: Use the Square CashDrawerShifts API [RetrieveCashDrawerShift](https://developer.squareup.com/reference/square_2021-02-26/cash-drawers-api/retrieve-cash-drawer-shift) endpoint. +* **v1 Transactions.BankAccounts:** + * The following endpoints are retired: + * `ListBankAccounts`: Use the Square Bank Accounts API [ListBankAccounts](https://developer.squareup.com/reference/square_2021-02-26/bank-accounts-api/list-bank-accounts) endpoint. + * `RetrieveBankAccount`: Use the Square Bank Accounts API [GetBankAccount](https://developer.squareup.com/reference/square_2021-02-26/bank-accounts-api/get-bank-account) endpoint. + +## SDKs + +* **All Square SDKs:** + + By default, all SDKs send requests to Square's production (https://connect.squareup.com) or sandbox (https://connect.squareupsandbox.com) hosts based on the client's `environment` parameter. + + You now have the option to use a custom URL instead. To use a custom URL, follow the example for your language to set the `environment` parameter to `custom` and the `customUrl` parameter to your URL: + + - Java + + ```java + new SquareClient.Builder() + .environment(Environment.CUSTOM) + .customUrl("https://example.com") + ``` + + - .NET + + ```csharp + new Square.SquareClient.Builder() + .Environment(Environment.Custom) + .CustomUrl("https://example.com") + ``` + + - Node.js + + ```javascript + new Client({ + environment: Environment.Custom, + customUrl: 'https://example.com' + }); + ``` + + - PHP + + ```php + new Square\SquareClient([ + 'environment' => Environment::CUSTOM, + 'customUrl' => 'https://example.com', + ]); + ``` + + - Python + + ```python + Client( + environment = 'custom', + custom_url = 'https://example.com',) + ``` + + - Ruby + + ```ruby + Square::Client.new( + environment: 'custom', + custom_url: 'https://example.com' + }); + ``` + + +* **Square .NET SDK:** + + Square has overridden the `Equals` and `GetHashCode` methods for models: + + * In the `Equals` override, Square has implemented a field-level comparison. + * The Square `GetHashCode` override now ensures that hashes are deterministic and unique for each object. + +* **Square Node.js SDK:** + + Endpoints that return 64-bit integers now return a `BigInt` object instead of a `Number` object. + + +* **Connect Node.js SDK:** (deprecated) + + The deprecated Connect Node.js SDK is in the security [maintenance state.](https://developer.squareup.com/docs/build-basics/api-lifecycle#maintenance) It does not receive any bug fixes or API updates from the Square version 2021-02-26 release. However, the SDK will receive support and security patches until it is retired (end of life) in the second quarter of 2021. For more information, including steps for migrating to the [Square Node.js SDK,](https://github.com/square/square-nodejs-sdk) see the [Connect SDK README.](https://github.com/square/connect-nodejs-sdk/blob/master/README.md) + +## Documentation updates +* **Catalog API:** + * [Update Catalog Objects.](https://developer.squareup.com/docs/catalog-api/update-catalog-objects) Provides programming guidance to update catalog objects. + +* **Inventory API:** + * [List or retrieve inventory.](https://developer.squareup.com/docs/migrate-from-v1/guides/v1-items#list-or-retrieve-inventory) Migrate the retired v1 endpoint of `ListInventory` to the v2 endpoint of `BatchRetrieveInventoryCounts`. Compare and contrast the programming patterns between the v1 endpoint of `ListInventory` and its v2 counterparts of [BatchRetrieveInventoryCounts](https://developer.squareup.com/reference/square_2021-02-26/inventory-api/batch-retrieve-inventory-counts) or [RetrieveInventoryCount](https://developer.squareup.com/reference/square_2021-02-26/inventory-api/retrieve-inventory-count). + * [Adjust or change inventory.](https://developer.squareup.com/docs/migrate-from-v1/guides/v1-items#adjust-or-change-inventory) Migrate the retired v1 endpoint of `AdjustInventory` to the v2 endpoint of `BatchChangeInventory`. Compare and contrast the programming patterns between the v1 endpoint of `AdjustInventory` and its v2 counterparts of [BatchChangeInventory](https://developer.squareup.com/reference/square_2021-02-26/inventory-api/batch-change-inventory). + +* **Get Started topic.** Revised the [Get Started](https://developer.squareup.com/docs/get-started) experience. In addition to clarifications, it now includes the use of the Square Sandbox and API Explorer. These are the tools and environments developers use to explore Square APIs. + + +## Version 8.1.1 (2021-01-27T00:00) +## SDKs +* Fixed Node.js test `testCreateInvoice`. Uses `Invoice.delivery_method` instead of deprecated field `InvoicePaymentRequest.request_method` + +## Version 8.1.0 (2021-01-21T00:00) +## Existing API updates + +* **Invoices API:** (beta) + + The `InvoicePaymentRequest.request_method` field is deprecated, and its current options are separated into two new fields that better represent their scope: + * `Invoice.delivery_method` specifies how Square should send invoices, reminders, and receipts to the customer. + * `InvoicePaymentRequest.automatic_payment_source` specifies the payment method for an automatic payment. + + As part of this change, the [InvoiceDeliveryMethod](https://developer.squareup.com/reference/square_2021-01-21/enums/InvoiceDeliveryMethod) and [InvoiceAutomaticPaymentSource](https://developer.squareup.com/reference/square_2021-01-21/enums/InvoiceAutomaticPaymentSource) enums are added and the `InvoiceRequestMethod` enum is deprecated. + + The Invoices API will continue to accept `request_method` in create and update requests until the field is retired, but starting in this version, `request_method` is not included in returned `Invoice` objects. For more information, see the [migration notes.](https://developer.squareup.com/docs/invoices-api/overview#migrate-InvoicePaymentRequest.request_method) + + +* **Locations API:** + * The [Locations.MCC](https://developer.squareup.com/reference/square_2021-01-21/objects/Location#definition__property-mcc) field is now updatable (beta). You can use the `UpdateLocation` endpoint to update the merchant category code (MCC) associated with a seller location. For more information, see [Initialize a merchant category code.](https://developer.squareup.com/docs/locations-api#initialize-a-merchant-category-code) + + + + +## SDKs +* **Connect Node.js SDK:** (deprecated) + + The deprecated Connect Node.js SDK is in the security [maintenance state.](https://developer.squareup.com/docs/build-basics/api-lifecycle#maintenance) It will not receive any bug fixes or API updates from the Square version 2021-01-21 release. However, the SDK will receive support and security patches until it is retired (EOL) in Q2, 2021. For more information, including steps for migrating to the [Square Node.js SDK,](https://github.com/square/square-nodejs-sdk) see the [Connect SDK README.](https://github.com/square/connect-nodejs-sdk/blob/master/README.md) + +## Documentation updates +* **Catalog API:** + * The [Use Item Options to Manage Item Variations](https://developer.squareup.com/docs/catalog-api/item-options-migration) topic is added. It demonstrates how item variations are usually used and how item options can be used to enable random access to item variations. + +* **Inventory API:** + * The [Inventory API](inventory-api/what-it-does) content is updated. It provides clearer guidance about how to use the API, with a task-oriented TOC and improved code examples. + + + +## Version 8.0.0 (2020-12-16T00:00) +## Existing API updates + +* **Orders API:** + * [OrderLineItemPricingBlocklists.](https://developer.squareup.com/reference/square_2020-12-16/objects/OrderLineItemPricingBlocklists) You can explicitly specify taxes and discounts in an order or automatically apply preconfigured taxes and discounts to an order. In addition, you can now block applying these taxes and discounts to a specific [OrderLineItem](https://developer.squareup.com/reference/square_2020-12-16/objects/OrderLineItem) in an [order](https://developer.squareup.com/reference/square_2020-12-16/objects/Order). You add the `pricing_blocklists` attribute to individual line items and specify the `blocked_discounts` and `blocked_taxes` that you do not want to apply. For more information, see [Apply Taxes and Discounts.](https://developer.squareup.com/docs/orders-api/apply-taxes-and-discounts) For example walkthroughs, see [Automatically Apply Discounts](https://developer.squareup.com/docs/orders-api/apply-taxes-and-discounts/auto-apply-discounts) and [Automatically Apply Taxes.](https://developer.squareup.com/docs/orders-api/apply-taxes-and-discounts/auto-apply-taxes) + * [OrderPricingOptions](https://developer.squareup.com/reference/square_2020-12-16/objects/OrderPricingOptions). Previously, the `pricing_options` field in an [order](https://developer.squareup.com/reference/square_2020-12-16/objects/OrderPricingOptions) supported only `auto_apply_discounts` to enable the automatic application of preconfigured discounts. Now it also supports `auto_apply_taxes` to enable the automatic application of preconfigured taxes. For more information, see [Automatically apply preconfigured catalog taxes or discounts.](https://developer.squareup.com/docs/orders-api/apply-taxes-and-discounts#automatically-apply-preconfigured-catalog-taxes-or-discounts) + + * [OrderLineItemTax](https://developer.squareup.com/reference/square_2020-12-16/objects/OrderLineItemTax). It now includes the new `auto_applied` field. It indicates whether the tax was automatically applied using a preconfigured [CatalogTax](https://developer.squareup.com/reference/square_2020-12-16/objects/CatalogTax). + + +* **Bookings API:** + * The [CancelBooking](https://developer.squareup.com/reference/square_2020-12-16/bookings-api/cancel-booking) endpoint supports canceling an accepted or pending booking. + * The [booking.created](https://developer.squareup.com/reference/square_2020-12-16/webhooks/booking.created) webhook event notifies when a new booking is created by calling the [CreateBooking](https://developer.squareup.com/reference/square_2020-12-16/bookings-api/cancel-booking) endpoint. + * The [booking.updated](https://developer.squareup.com/reference/square_2020-12-16/webhooks/booking.updated) webhook event notifies when an existing booking is updated. + +* **Catalog API:** + * [ListCatalog](https://developer.squareup.com/reference/square_2020-12-16/catalog-api/list-catalog), [RetrieveCatalogObject](https://developer.squareup.com/reference/square_2020-12-16/catalog-api/retrieve-catalog-object), and [BatchRetrieveCatalogObjects](https://developer.squareup.com/reference/square_2020-12-16/catalog-api/batch-retrieve-catalog-objects) now support the `catalog_version` filter to return catalog objects of the specified version. + +* **Customers API:** + * [SearchCustomers](https://developer.squareup.com/reference/square_2020-12-16/customers-api/search-customers) endpoint. The `email_address`, `group_ids`, `phone_number`, and `reference_id` query filters are now generally available (GA). + * The [Customer Groups](https://developer.squareup.com/reference/square_2020-12-16/customer-groups-api) API is now GA. + * The [Customer Segments](https://developer.squareup.com/reference/square_2020-12-16/customer-segments-api) API is now GA. + + +* **Invoices API:** (beta) + * [Invoice](https://developer.squareup.com/reference/square_2020-12-16/objects/Invoice) object. Added the `custom_fields` field, which contains up to two customer-facing, seller-defined fields to display on the invoice. For more information, see [Custom fields.](https://developer.squareup.com/docs/invoices-api/overview#custom-fields) + As part of this change, the following objects are added: + * [InvoiceCustomField](https://developer.squareup.com/reference/square_2020-12-16/objects/InvoiceCustomField) object + * [InvoiceCustomFieldPlacement](https://developer.squareup.com/reference/square_2020-12-16/enums/InvoiceCustomFieldPlacement) enum + * [InvoiceRequestMethod](https://developer.squareup.com/reference/square_2020-12-16/enums/InvoiceRequestMethod) enum. Added the read-only CHARGE_BANK_ON_FILE value, which represents a bank transfer automatic payment method for a recurring invoice. + + +* **Loyalty API:** (beta) + * [LoyaltyProgramRewardTier](https://developer.squareup.com/reference/square_2020-12-16/objects/LoyaltyProgramRewardTier) object. The `definition` field in this type is deprecated and replaced by the new `pricing_rule_reference` field. You can use `pricing_rule_reference` fields to retrieve catalog objects that define the discount details for the reward tier. For more information, see [Get discount details for a reward tier.](https://developer.squareup.com/docs/loyalty-api/overview#get-discount-details-for-a-reward-tier) + As part of this change, the following APIs are deprecated: + * [LoyaltyProgramRewardDefinition](https://developer.squareup.com/reference/square_2020-12-16/objects/LoyaltyProgramRewardDefinition) object + * [LoyaltyProgramRewardDefinitionScope](https://developer.squareup.com/reference/square_2020-12-16/enums/LoyaltyProgramRewardDefinitionScope) enum + * [LoyaltyProgramRewardDefinitionType](https://developer.squareup.com/reference/square_2020-12-16/enums/LoyaltyProgramRewardDefinitionType) enum + +## New SDK release +* **Square Node.js SDK:** + + The new [Square Node.js SDK](https://github.com/square/square-nodejs-sdk) is now GA and replaces the deprecated Connect Node.js SDK. For migration information, see the [Connect SDK README.](https://github.com/square/connect-nodejs-sdk/blob/master/README.md) + + +## Documentation updates + +* [Get Right-Sized Permissions with Down-Scoped OAuth Tokens.](https://developer.squareup.com/docs/oauth-api/cookbook/downscoped-access) This new OAuth API topic shows how to get an additional reduced-scope OAuth token with a 24-hour expiration by using the refresh token from the Square account authorization OAuth flow. + + +## Version 7.0.0 (2020-11-18T00:00) +## New API releases + +* **Bookings API** (beta). This API enables you, as an application developer, to create applications to set up and manage bookings for appointments of fixed duration in which selected staff members of a Square seller provide specified services in supported locations for particular customers. + * For an overview, see [Manage Bookings for Square Sellers](https://developer.squareup.com/docs/bookings-api/what-it-is). + * For technical reference, see [Bookings API](https://developer.squareup.com/reference/square_2020-11-18/bookings-api). + +## Existing API updates + +* **Payments API:** + * [Payment.](https://developer.squareup.com/reference/square_2020-11-18/objects/Payment) The object now includes the `risk_evaluation` field to identify the Square-assigned risk level associated with the payment. Sellers can use this information to provide the goods and services or refund the payment. + +## New SDK release +* **New Square Node.js SDK (beta)** + + The new [Square Node.js SDK](https://github.com/square/square-nodejs-sdk) is available in beta and will eventually replace the deprecated Connect Node.js SDK. For migration information, see the [Connect SDK README.](https://github.com/square/connect-nodejs-sdk/blob/master/README.md) The following topics are updated to use the new SDK: + * [Walkthrough: Integrate Square Payments in a Website](https://developer.squareup.com/docs/payment-form/payment-form-walkthrough) + * [Verify the Buyer When Using a Nonce for an Online Payment](https://developer.squareup.com/docs/payment-form/cookbook/verify-buyer-on-card-charge) + * [Create a Gift Card Payment Endpoint](https://developer.squareup.com/docs/payment-form/gift-cards/part-2) + + +## Documentation Updates + +* The **Testing** topics are moved from the end of the table of contents to the top, in the **Home** section under [Testing your App](https://developer.squareup.com/docs/testing-your-app). +* [Pay for orders.]](https://developer.squareup.com/docs/orders-api/pay-for-order) Topic revised to add clarity when to use Payments API and Orders API to pay for an order. The [Orders Integration]](https://developer.squareup.com/docs/payments-api/take-payments?preview=true#orders-integration) topic in Payments API simplified accordingly. diff --git a/legacy/README.md b/legacy/README.md new file mode 100644 index 000000000..1f598e529 --- /dev/null +++ b/legacy/README.md @@ -0,0 +1,157 @@ +# Square Legacy Node.js SDK + +Use this JavaScript library to manage Square resources (such as payments, orders, items, and inventory) for your own Square account or on behalf of Square sellers. + +* [Requirements](#requirements) +* [Installation](#installation) +* [Quickstart](#quickstart) +* [Usage](#usage) +* [Tests](#tests) +* [SDK Reference](#sdk-reference) +* [Deprecated APIs](#deprecated-apis) + +## Requirements + +Use of the Square Node.js SDK requires: + +* Node.js 14 or higher + +This SDK supports Node.js versions that are either current, or that are in long-term support status (LTS). The SDK does not support Node.js versions that have reached their end-of-life (EOL). For more information on Node.js versioning, see . + +This SDK is for use with Node.js only. It does not support other usages, such as for web browsers or frontend applications. + +## Installation + +For more information, see [Set Up Your Square SDK for a Node.js Project](https://developer.squareup.com/docs/sdks/nodejs/setup-project). + +## Quickstart + +For more information, see [Square Node.js SDK Quickstart](https://developer.squareup.com/docs/sdks/nodejs/quick-start). + +## Usage +For more information, see [Using the Square Node.js SDK](https://developer.squareup.com/docs/sdks/nodejs/using-nodejs-sdk). + +## SDK Reference + +### Payments +* [Payments] +* [Refunds] +* [Disputes] +* [Checkout] +* [Apple Pay] +* [Cards] +* [Payouts] + +### Terminal +* [Terminal] + +### Orders +* [Orders] +* [Order Custom Attributes] + +### Subscriptions +* [Subscriptions] + +### Invoices +* [Invoices] + +### Items +* [Catalog] +* [Inventory] + +### Customers +* [Customers] +* [Customer Groups] +* [Customer Segments] + +### Loyalty +* [Loyalty] + +### Gift Cards +* [Gift Cards] +* [Gift Card Activities] + +### Bookings +* [Bookings] +* [Booking Custom Attributes] + +### Business +* [Merchants] +* [Merchant Custom Attributes] +* [Locations] +* [Location Custom Attributes] +* [Devices] +* [Cash Drawers] + +### Team +* [Team] +* [Labor] + +### Financials +* [Bank Accounts] + +### Online +* [Sites] +* [Snippets] + +### Authorization +* [Mobile Authorization] +* [OAuth] + +### Webhook Subscriptions +* [Webhook Subscriptions] +## Deprecated APIs + +The following Square APIs are [deprecated](https://developer.squareup.com/docs/build-basics/api-lifecycle): + +* [Employees] - replaced by the [Team] API. For more information, see [Migrate from the Employees API](https://developer.squareup.com/docs/team/migrate-from-v2-employees). + +* [Transactions] - replaced by the [Orders] and [Payments] APIs. For more information, see [Migrate from the Transactions API](https://developer.squareup.com/docs/payments-api/migrate-from-transactions-api). + + +[Developer Dashboard]: https://developer.squareup.com/apps +[Square API]: https://squareup.com/developers +[sign up for a developer account]: https://squareup.com/signup?v=developers +[Locations overview]: https://developer.squareup.com/docs/locations-api +[OAuth overview]: https://developer.squareup.com/docs/oauth-api/overview +[Client]: doc/client.md +[Devices]: doc/api/devices.md +[Disputes]: doc/api/disputes.md +[Terminal]: doc/api/terminal.md +[Team]: doc/api/team.md +[Cash Drawers]: doc/api/cash-drawers.md +[Vendors]: doc/api/vendors.md +[Customer Groups]: doc/api/customer-groups.md +[Customer Segments]: doc/api/customer-segments.md +[Bank Accounts]: doc/api/bank-accounts.md +[Payments]: doc/api/payments.md +[Checkout]: doc/api/checkout.md +[Catalog]: doc/api/catalog.md +[Customers]: doc/api/customers.md +[Customer Custom Attributes]: doc/api/customer-custom-attributes.md +[Inventory]: doc/api/inventory.md +[Labor]: doc/api/labor.md +[Loyalty]: doc/api/loyalty.md +[Bookings]: doc/api/bookings.md +[Booking Custom Attributes]: doc/api/booking-custom-attributes.md +[Locations]: doc/api/locations.md +[Location Custom Attributes]: doc/api/location-custom-attributes.md +[Merchants]: doc/api/merchants.md +[Merchant Custom Attributes]: doc/api/merchant-custom-attributes.md +[Orders]: doc/api/orders.md +[Order Custom Attributes]: doc/api/order-custom-attributes.md +[Invoices]: doc/api/invoices.md +[Apple Pay]: doc/api/apple-pay.md +[Refunds]: doc/api/refunds.md +[Subscriptions]: doc/api/subscriptions.md +[Mobile Authorization]: doc/api/mobile-authorization.md +[OAuth]: doc/api/o-auth.md +[Sites]: doc/api/sites.md +[Snippets]: doc/api/snippets.md +[Cards]: doc/api/cards.md +[Payouts]: doc/api/payouts.md +[Gift Cards]: doc/api/gift-cards.md +[Gift Card Activities]: doc/api/gift-card-activities.md +[Employees]: doc/api/employees.md +[Transactions]: doc/api/transactions.md +[Webhook Subscriptions]: doc/api/webhook-subscriptions.md diff --git a/legacy/doc/api-error.md b/legacy/doc/api-error.md new file mode 100644 index 000000000..60d30c4f4 --- /dev/null +++ b/legacy/doc/api-error.md @@ -0,0 +1,18 @@ + +# ApiError + +Thrown when the HTTP status code is not okay. + +The ApiError extends the ApiResponse interface, so all ApiResponse properties are available. + +## Properties + +| Name | Type | Description | +| --- | --- | --- | +| request | HttpRequest | Original request that resulted in this response. | +| statusCode | number | Response status code. | +| headers | Record | Response headers. | +| result | T | Response data. | +| body | string \| Blob \| NodeJS.ReadableStream | Original body from the response. | +| errors? | Error[] | Represents an error encountered during a request to the Connect API | + diff --git a/legacy/doc/api-response.md b/legacy/doc/api-response.md new file mode 100644 index 000000000..1e886c9e1 --- /dev/null +++ b/legacy/doc/api-response.md @@ -0,0 +1,15 @@ + +# ApiResponse + +An interface for the result of an API call. + +## Properties + +| Name | Type | Description | +| --- | --- | --- | +| request | HttpRequest | Original request that resulted in this response. | +| statusCode | number | Response status codee. | +| headers | Record | Response headers. | +| result | T | Response data. | +| body | string \| Blob \| NodeJS.ReadableStream | Original body from the response. | + diff --git a/legacy/doc/api/apple-pay.md b/legacy/doc/api/apple-pay.md new file mode 100644 index 000000000..867c9b2de --- /dev/null +++ b/legacy/doc/api/apple-pay.md @@ -0,0 +1,65 @@ +# Apple Pay + +```ts +const applePayApi = client.applePayApi; +``` + +## Class Name + +`ApplePayApi` + + +# Register Domain + +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). + +```ts +async registerDomain( + body: RegisterDomainRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`RegisterDomainRequest`](../../doc/models/register-domain-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RegisterDomainResponse`](../../doc/models/register-domain-response.md) + +## Example Usage + +```ts +const body: RegisterDomainRequest = { + domainName: 'example.com', +}; + +try { + const { result, ...httpResponse } = await applePayApi.registerDomain(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/bank-accounts.md b/legacy/doc/api/bank-accounts.md new file mode 100644 index 000000000..7bfa7a63f --- /dev/null +++ b/legacy/doc/api/bank-accounts.md @@ -0,0 +1,139 @@ +# Bank Accounts + +```ts +const bankAccountsApi = client.bankAccountsApi; +``` + +## Class Name + +`BankAccountsApi` + +## Methods + +* [List Bank Accounts](../../doc/api/bank-accounts.md#list-bank-accounts) +* [Get Bank Account by V1 Id](../../doc/api/bank-accounts.md#get-bank-account-by-v1-id) +* [Get Bank Account](../../doc/api/bank-accounts.md#get-bank-account) + + +# List Bank Accounts + +Returns a list of [BankAccount](../../doc/models/bank-account.md) objects linked to a Square account. + +```ts +async listBankAccounts( + cursor?: string, + limit?: number, + locationId?: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `cursor` | `string \| undefined` | Query, Optional | 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` | `number \| undefined` | Query, Optional | 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. | +| `locationId` | `string \| undefined` | Query, Optional | Location ID. You can specify this optional filter
to retrieve only the linked bank accounts belonging to a specific location. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListBankAccountsResponse`](../../doc/models/list-bank-accounts-response.md) + +## Example Usage + +```ts +try { + const { result, ...httpResponse } = await bankAccountsApi.listBankAccounts(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Get Bank Account by V1 Id + +Returns details of a [BankAccount](../../doc/models/bank-account.md) identified by V1 bank account ID. + +```ts +async getBankAccountByV1Id( + v1BankAccountId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `v1BankAccountId` | `string` | Template, Required | 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). | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`GetBankAccountByV1IdResponse`](../../doc/models/get-bank-account-by-v1-id-response.md) + +## Example Usage + +```ts +const v1BankAccountId = 'v1_bank_account_id8'; + +try { + const { result, ...httpResponse } = await bankAccountsApi.getBankAccountByV1Id(v1BankAccountId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Get Bank Account + +Returns details of a [BankAccount](../../doc/models/bank-account.md) +linked to a Square account. + +```ts +async getBankAccount( + bankAccountId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `bankAccountId` | `string` | Template, Required | Square-issued ID of the desired `BankAccount`. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`GetBankAccountResponse`](../../doc/models/get-bank-account-response.md) + +## Example Usage + +```ts +const bankAccountId = 'bank_account_id0'; + +try { + const { result, ...httpResponse } = await bankAccountsApi.getBankAccount(bankAccountId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/booking-custom-attributes.md b/legacy/doc/api/booking-custom-attributes.md new file mode 100644 index 000000000..c051cf499 --- /dev/null +++ b/legacy/doc/api/booking-custom-attributes.md @@ -0,0 +1,606 @@ +# Booking Custom Attributes + +```ts +const bookingCustomAttributesApi = client.bookingCustomAttributesApi; +``` + +## Class Name + +`BookingCustomAttributesApi` + +## Methods + +* [List Booking Custom Attribute Definitions](../../doc/api/booking-custom-attributes.md#list-booking-custom-attribute-definitions) +* [Create Booking Custom Attribute Definition](../../doc/api/booking-custom-attributes.md#create-booking-custom-attribute-definition) +* [Delete Booking Custom Attribute Definition](../../doc/api/booking-custom-attributes.md#delete-booking-custom-attribute-definition) +* [Retrieve Booking Custom Attribute Definition](../../doc/api/booking-custom-attributes.md#retrieve-booking-custom-attribute-definition) +* [Update Booking Custom Attribute Definition](../../doc/api/booking-custom-attributes.md#update-booking-custom-attribute-definition) +* [Bulk Delete Booking Custom Attributes](../../doc/api/booking-custom-attributes.md#bulk-delete-booking-custom-attributes) +* [Bulk Upsert Booking Custom Attributes](../../doc/api/booking-custom-attributes.md#bulk-upsert-booking-custom-attributes) +* [List Booking Custom Attributes](../../doc/api/booking-custom-attributes.md#list-booking-custom-attributes) +* [Delete Booking Custom Attribute](../../doc/api/booking-custom-attributes.md#delete-booking-custom-attribute) +* [Retrieve Booking Custom Attribute](../../doc/api/booking-custom-attributes.md#retrieve-booking-custom-attribute) +* [Upsert Booking Custom Attribute](../../doc/api/booking-custom-attributes.md#upsert-booking-custom-attribute) + + +# List Booking Custom Attribute Definitions + +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. + +```ts +async listBookingCustomAttributeDefinitions( + limit?: number, + cursor?: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `limit` | `number \| undefined` | Query, Optional | 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` | `string \| undefined` | Query, Optional | 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). | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListBookingCustomAttributeDefinitionsResponse`](../../doc/models/list-booking-custom-attribute-definitions-response.md) + +## Example Usage + +```ts +try { + const { result, ...httpResponse } = await bookingCustomAttributesApi.listBookingCustomAttributeDefinitions(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Create Booking Custom Attribute Definition + +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*. + +```ts +async createBookingCustomAttributeDefinition( + body: CreateBookingCustomAttributeDefinitionRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`CreateBookingCustomAttributeDefinitionRequest`](../../doc/models/create-booking-custom-attribute-definition-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CreateBookingCustomAttributeDefinitionResponse`](../../doc/models/create-booking-custom-attribute-definition-response.md) + +## Example Usage + +```ts +const body: CreateBookingCustomAttributeDefinitionRequest = { + customAttributeDefinition: { + }, +}; + +try { + const { result, ...httpResponse } = await bookingCustomAttributesApi.createBookingCustomAttributeDefinition(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Delete Booking Custom Attribute Definition + +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*. + +```ts +async deleteBookingCustomAttributeDefinition( + key: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `key` | `string` | Template, Required | The key of the custom attribute definition to delete. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`DeleteBookingCustomAttributeDefinitionResponse`](../../doc/models/delete-booking-custom-attribute-definition-response.md) + +## Example Usage + +```ts +const key = 'key0'; + +try { + const { result, ...httpResponse } = await bookingCustomAttributesApi.deleteBookingCustomAttributeDefinition(key); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Booking Custom Attribute Definition + +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. + +```ts +async retrieveBookingCustomAttributeDefinition( + key: string, + version?: number, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `key` | `string` | Template, Required | The key of the custom attribute definition to retrieve. If the requesting application
is not the definition owner, you must use the qualified key. | +| `version` | `number \| undefined` | Query, Optional | 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. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveBookingCustomAttributeDefinitionResponse`](../../doc/models/retrieve-booking-custom-attribute-definition-response.md) + +## Example Usage + +```ts +const key = 'key0'; + +try { + const { result, ...httpResponse } = await bookingCustomAttributesApi.retrieveBookingCustomAttributeDefinition(key); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Update Booking Custom Attribute Definition + +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*. + +```ts +async updateBookingCustomAttributeDefinition( + key: string, + body: UpdateBookingCustomAttributeDefinitionRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `key` | `string` | Template, Required | The key of the custom attribute definition to update. | +| `body` | [`UpdateBookingCustomAttributeDefinitionRequest`](../../doc/models/update-booking-custom-attribute-definition-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`UpdateBookingCustomAttributeDefinitionResponse`](../../doc/models/update-booking-custom-attribute-definition-response.md) + +## Example Usage + +```ts +const key = 'key0'; + +const body: UpdateBookingCustomAttributeDefinitionRequest = { + customAttributeDefinition: { + }, +}; + +try { + const { result, ...httpResponse } = await bookingCustomAttributesApi.updateBookingCustomAttributeDefinition( + key, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Bulk Delete Booking Custom Attributes + +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*. + +```ts +async bulkDeleteBookingCustomAttributes( + body: BulkDeleteBookingCustomAttributesRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BulkDeleteBookingCustomAttributesRequest`](../../doc/models/bulk-delete-booking-custom-attributes-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`BulkDeleteBookingCustomAttributesResponse`](../../doc/models/bulk-delete-booking-custom-attributes-response.md) + +## Example Usage + +```ts +const body: BulkDeleteBookingCustomAttributesRequest = { + values: { + 'key0': { + bookingId: 'booking_id4', + key: 'key0', + }, + 'key1': { + bookingId: 'booking_id4', + key: 'key0', + } + }, +}; + +try { + const { result, ...httpResponse } = await bookingCustomAttributesApi.bulkDeleteBookingCustomAttributes(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Bulk Upsert Booking Custom Attributes + +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*. + +```ts +async bulkUpsertBookingCustomAttributes( + body: BulkUpsertBookingCustomAttributesRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BulkUpsertBookingCustomAttributesRequest`](../../doc/models/bulk-upsert-booking-custom-attributes-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`BulkUpsertBookingCustomAttributesResponse`](../../doc/models/bulk-upsert-booking-custom-attributes-response.md) + +## Example Usage + +```ts +const body: BulkUpsertBookingCustomAttributesRequest = { + values: { + 'key0': { + bookingId: 'booking_id4', + customAttribute: { + }, + }, + 'key1': { + bookingId: 'booking_id4', + customAttribute: { + }, + } + }, +}; + +try { + const { result, ...httpResponse } = await bookingCustomAttributesApi.bulkUpsertBookingCustomAttributes(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# List Booking Custom Attributes + +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. + +```ts +async listBookingCustomAttributes( + bookingId: string, + limit?: number, + cursor?: string, + withDefinitions?: boolean, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `bookingId` | `string` | Template, Required | The ID of the target [booking](entity:Booking). | +| `limit` | `number \| undefined` | Query, Optional | 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` | `string \| undefined` | Query, Optional | 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). | +| `withDefinitions` | `boolean \| undefined` | Query, Optional | 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`.
**Default**: `false` | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListBookingCustomAttributesResponse`](../../doc/models/list-booking-custom-attributes-response.md) + +## Example Usage + +```ts +const bookingId = 'booking_id4'; + +const withDefinitions = false; + +try { + const { result, ...httpResponse } = await bookingCustomAttributesApi.listBookingCustomAttributes( + bookingId, + undefined, + undefined, + withDefinitions +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Delete Booking Custom Attribute + +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*. + +```ts +async deleteBookingCustomAttribute( + bookingId: string, + key: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `bookingId` | `string` | Template, Required | The ID of the target [booking](entity:Booking). | +| `key` | `string` | Template, Required | 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. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`DeleteBookingCustomAttributeResponse`](../../doc/models/delete-booking-custom-attribute-response.md) + +## Example Usage + +```ts +const bookingId = 'booking_id4'; + +const key = 'key0'; + +try { + const { result, ...httpResponse } = await bookingCustomAttributesApi.deleteBookingCustomAttribute( + bookingId, + key +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Booking Custom Attribute + +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. + +```ts +async retrieveBookingCustomAttribute( + bookingId: string, + key: string, + withDefinition?: boolean, + version?: number, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `bookingId` | `string` | Template, Required | The ID of the target [booking](entity:Booking). | +| `key` | `string` | Template, Required | 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. | +| `withDefinition` | `boolean \| undefined` | Query, Optional | 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`.
**Default**: `false` | +| `version` | `number \| undefined` | Query, Optional | 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. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveBookingCustomAttributeResponse`](../../doc/models/retrieve-booking-custom-attribute-response.md) + +## Example Usage + +```ts +const bookingId = 'booking_id4'; + +const key = 'key0'; + +const withDefinition = false; + +try { + const { result, ...httpResponse } = await bookingCustomAttributesApi.retrieveBookingCustomAttribute( + bookingId, + key, + withDefinition +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Upsert Booking Custom Attribute + +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*. + +```ts +async upsertBookingCustomAttribute( + bookingId: string, + key: string, + body: UpsertBookingCustomAttributeRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `bookingId` | `string` | Template, Required | The ID of the target [booking](entity:Booking). | +| `key` | `string` | Template, Required | 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` | [`UpsertBookingCustomAttributeRequest`](../../doc/models/upsert-booking-custom-attribute-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`UpsertBookingCustomAttributeResponse`](../../doc/models/upsert-booking-custom-attribute-response.md) + +## Example Usage + +```ts +const bookingId = 'booking_id4'; + +const key = 'key0'; + +const body: UpsertBookingCustomAttributeRequest = { + customAttribute: { + }, +}; + +try { + const { result, ...httpResponse } = await bookingCustomAttributesApi.upsertBookingCustomAttribute( + bookingId, + key, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/bookings.md b/legacy/doc/api/bookings.md new file mode 100644 index 000000000..cfb229f45 --- /dev/null +++ b/legacy/doc/api/bookings.md @@ -0,0 +1,636 @@ +# Bookings + +```ts +const bookingsApi = client.bookingsApi; +``` + +## Class Name + +`BookingsApi` + +## Methods + +* [List Bookings](../../doc/api/bookings.md#list-bookings) +* [Create Booking](../../doc/api/bookings.md#create-booking) +* [Search Availability](../../doc/api/bookings.md#search-availability) +* [Bulk Retrieve Bookings](../../doc/api/bookings.md#bulk-retrieve-bookings) +* [Retrieve Business Booking Profile](../../doc/api/bookings.md#retrieve-business-booking-profile) +* [List Location Booking Profiles](../../doc/api/bookings.md#list-location-booking-profiles) +* [Retrieve Location Booking Profile](../../doc/api/bookings.md#retrieve-location-booking-profile) +* [List Team Member Booking Profiles](../../doc/api/bookings.md#list-team-member-booking-profiles) +* [Bulk Retrieve Team Member Booking Profiles](../../doc/api/bookings.md#bulk-retrieve-team-member-booking-profiles) +* [Retrieve Team Member Booking Profile](../../doc/api/bookings.md#retrieve-team-member-booking-profile) +* [Retrieve Booking](../../doc/api/bookings.md#retrieve-booking) +* [Update Booking](../../doc/api/bookings.md#update-booking) +* [Cancel Booking](../../doc/api/bookings.md#cancel-booking) + + +# List Bookings + +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. + +```ts +async listBookings( + limit?: number, + cursor?: string, + customerId?: string, + teamMemberId?: string, + locationId?: string, + startAtMin?: string, + startAtMax?: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `limit` | `number \| undefined` | Query, Optional | The maximum number of results per page to return in a paged response. | +| `cursor` | `string \| undefined` | Query, Optional | 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. | +| `customerId` | `string \| undefined` | Query, Optional | The [customer](entity:Customer) for whom to retrieve bookings. If this is not set, bookings for all customers are retrieved. | +| `teamMemberId` | `string \| undefined` | Query, Optional | The team member for whom to retrieve bookings. If this is not set, bookings of all members are retrieved. | +| `locationId` | `string \| undefined` | Query, Optional | The location for which to retrieve bookings. If this is not set, all locations' bookings are retrieved. | +| `startAtMin` | `string \| undefined` | Query, Optional | The RFC 3339 timestamp specifying the earliest of the start time. If this is not set, the current time is used. | +| `startAtMax` | `string \| undefined` | Query, Optional | 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. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListBookingsResponse`](../../doc/models/list-bookings-response.md) + +## Example Usage + +```ts +try { + const { result, ...httpResponse } = await bookingsApi.listBookings(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Create Booking + +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*. + +```ts +async createBooking( + body: CreateBookingRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`CreateBookingRequest`](../../doc/models/create-booking-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CreateBookingResponse`](../../doc/models/create-booking-response.md) + +## Example Usage + +```ts +const body: CreateBookingRequest = { + booking: { + }, +}; + +try { + const { result, ...httpResponse } = await bookingsApi.createBooking(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Search Availability + +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. + +```ts +async searchAvailability( + body: SearchAvailabilityRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`SearchAvailabilityRequest`](../../doc/models/search-availability-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`SearchAvailabilityResponse`](../../doc/models/search-availability-response.md) + +## Example Usage + +```ts +const body: SearchAvailabilityRequest = { + query: { + filter: { + startAtRange: { + }, + }, + }, +}; + +try { + const { result, ...httpResponse } = await bookingsApi.searchAvailability(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Bulk Retrieve Bookings + +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. + +```ts +async bulkRetrieveBookings( + body: BulkRetrieveBookingsRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BulkRetrieveBookingsRequest`](../../doc/models/bulk-retrieve-bookings-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`BulkRetrieveBookingsResponse`](../../doc/models/bulk-retrieve-bookings-response.md) + +## Example Usage + +```ts +const body: BulkRetrieveBookingsRequest = { + bookingIds: [ + 'booking_ids8', + 'booking_ids9', + 'booking_ids0' + ], +}; + +try { + const { result, ...httpResponse } = await bookingsApi.bulkRetrieveBookings(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Business Booking Profile + +Retrieves a seller's booking profile. + +```ts +async retrieveBusinessBookingProfile( + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveBusinessBookingProfileResponse`](../../doc/models/retrieve-business-booking-profile-response.md) + +## Example Usage + +```ts +try { + const { result, ...httpResponse } = await bookingsApi.retrieveBusinessBookingProfile(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# List Location Booking Profiles + +Lists location booking profiles of a seller. + +```ts +async listLocationBookingProfiles( + limit?: number, + cursor?: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `limit` | `number \| undefined` | Query, Optional | The maximum number of results to return in a paged response. | +| `cursor` | `string \| undefined` | Query, Optional | 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. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListLocationBookingProfilesResponse`](../../doc/models/list-location-booking-profiles-response.md) + +## Example Usage + +```ts +try { + const { result, ...httpResponse } = await bookingsApi.listLocationBookingProfiles(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Location Booking Profile + +Retrieves a seller's location booking profile. + +```ts +async retrieveLocationBookingProfile( + locationId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string` | Template, Required | The ID of the location to retrieve the booking profile. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveLocationBookingProfileResponse`](../../doc/models/retrieve-location-booking-profile-response.md) + +## Example Usage + +```ts +const locationId = 'location_id4'; + +try { + const { result, ...httpResponse } = await bookingsApi.retrieveLocationBookingProfile(locationId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# List Team Member Booking Profiles + +Lists booking profiles for team members. + +```ts +async listTeamMemberBookingProfiles( + bookableOnly?: boolean, + limit?: number, + cursor?: string, + locationId?: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `bookableOnly` | `boolean \| undefined` | Query, Optional | Indicates whether to include only bookable team members in the returned result (`true`) or not (`false`).
**Default**: `false` | +| `limit` | `number \| undefined` | Query, Optional | The maximum number of results to return in a paged response. | +| `cursor` | `string \| undefined` | Query, Optional | 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. | +| `locationId` | `string \| undefined` | Query, Optional | Indicates whether to include only team members enabled at the given location in the returned result. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListTeamMemberBookingProfilesResponse`](../../doc/models/list-team-member-booking-profiles-response.md) + +## Example Usage + +```ts +const bookableOnly = false; + +try { + const { result, ...httpResponse } = await bookingsApi.listTeamMemberBookingProfiles(bookableOnly); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Bulk Retrieve Team Member Booking Profiles + +Retrieves one or more team members' booking profiles. + +```ts +async bulkRetrieveTeamMemberBookingProfiles( + body: BulkRetrieveTeamMemberBookingProfilesRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BulkRetrieveTeamMemberBookingProfilesRequest`](../../doc/models/bulk-retrieve-team-member-booking-profiles-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`BulkRetrieveTeamMemberBookingProfilesResponse`](../../doc/models/bulk-retrieve-team-member-booking-profiles-response.md) + +## Example Usage + +```ts +const body: BulkRetrieveTeamMemberBookingProfilesRequest = { + teamMemberIds: [ + 'team_member_ids3', + 'team_member_ids4', + 'team_member_ids5' + ], +}; + +try { + const { result, ...httpResponse } = await bookingsApi.bulkRetrieveTeamMemberBookingProfiles(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Team Member Booking Profile + +Retrieves a team member's booking profile. + +```ts +async retrieveTeamMemberBookingProfile( + teamMemberId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `teamMemberId` | `string` | Template, Required | The ID of the team member to retrieve. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveTeamMemberBookingProfileResponse`](../../doc/models/retrieve-team-member-booking-profile-response.md) + +## Example Usage + +```ts +const teamMemberId = 'team_member_id0'; + +try { + const { result, ...httpResponse } = await bookingsApi.retrieveTeamMemberBookingProfile(teamMemberId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Booking + +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. + +```ts +async retrieveBooking( + bookingId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `bookingId` | `string` | Template, Required | The ID of the [Booking](entity:Booking) object representing the to-be-retrieved booking. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveBookingResponse`](../../doc/models/retrieve-booking-response.md) + +## Example Usage + +```ts +const bookingId = 'booking_id4'; + +try { + const { result, ...httpResponse } = await bookingsApi.retrieveBooking(bookingId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Update Booking + +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*. + +```ts +async updateBooking( + bookingId: string, + body: UpdateBookingRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `bookingId` | `string` | Template, Required | The ID of the [Booking](entity:Booking) object representing the to-be-updated booking. | +| `body` | [`UpdateBookingRequest`](../../doc/models/update-booking-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`UpdateBookingResponse`](../../doc/models/update-booking-response.md) + +## Example Usage + +```ts +const bookingId = 'booking_id4'; + +const body: UpdateBookingRequest = { + booking: { + }, +}; + +try { + const { result, ...httpResponse } = await bookingsApi.updateBooking( + bookingId, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Cancel Booking + +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*. + +```ts +async cancelBooking( + bookingId: string, + body: CancelBookingRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `bookingId` | `string` | Template, Required | The ID of the [Booking](entity:Booking) object representing the to-be-cancelled booking. | +| `body` | [`CancelBookingRequest`](../../doc/models/cancel-booking-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CancelBookingResponse`](../../doc/models/cancel-booking-response.md) + +## Example Usage + +```ts +const bookingId = 'booking_id4'; + +const body: CancelBookingRequest = { +}; + +try { + const { result, ...httpResponse } = await bookingsApi.cancelBooking( + bookingId, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/cards.md b/legacy/doc/api/cards.md new file mode 100644 index 000000000..004664f10 --- /dev/null +++ b/legacy/doc/api/cards.md @@ -0,0 +1,207 @@ +# Cards + +```ts +const cardsApi = client.cardsApi; +``` + +## Class Name + +`CardsApi` + +## Methods + +* [List Cards](../../doc/api/cards.md#list-cards) +* [Create Card](../../doc/api/cards.md#create-card) +* [Retrieve Card](../../doc/api/cards.md#retrieve-card) +* [Disable Card](../../doc/api/cards.md#disable-card) + + +# List Cards + +Retrieves a list of cards owned by the account making the request. +A max of 25 cards will be returned. + +```ts +async listCards( + cursor?: string, + customerId?: string, + includeDisabled?: boolean, + referenceId?: string, + sortOrder?: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `cursor` | `string \| undefined` | Query, Optional | 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. | +| `customerId` | `string \| undefined` | Query, Optional | Limit results to cards associated with the customer supplied.
By default, all cards owned by the merchant are returned. | +| `includeDisabled` | `boolean \| undefined` | Query, Optional | Includes disabled cards.
By default, all enabled cards owned by the merchant are returned.
**Default**: `false` | +| `referenceId` | `string \| undefined` | Query, Optional | Limit results to cards associated with the reference_id supplied. | +| `sortOrder` | [`string \| undefined`](../../doc/models/sort-order.md) | Query, Optional | Sorts the returned list by when the card was created with the specified order.
This field defaults to ASC. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListCardsResponse`](../../doc/models/list-cards-response.md) + +## Example Usage + +```ts +const includeDisabled = false; + +try { + const { result, ...httpResponse } = await cardsApi.listCards( + undefined, + undefined, + includeDisabled +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Create Card + +Adds a card on file to an existing merchant. + +```ts +async createCard( + body: CreateCardRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`CreateCardRequest`](../../doc/models/create-card-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CreateCardResponse`](../../doc/models/create-card-response.md) + +## Example Usage + +```ts +const body: CreateCardRequest = { + idempotencyKey: '4935a656-a929-4792-b97c-8848be85c27c', + sourceId: 'cnon:uIbfJXhXETSP197M3GB', + card: { + cardholderName: 'Amelia Earhart', + billingAddress: { + addressLine1: '500 Electric Ave', + addressLine2: 'Suite 600', + locality: 'New York', + administrativeDistrictLevel1: 'NY', + postalCode: '10003', + country: 'US', + }, + customerId: 'VDKXEEKPJN48QDG3BGGFAK05P8', + referenceId: 'user-id-1', + }, +}; + +try { + const { result, ...httpResponse } = await cardsApi.createCard(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Card + +Retrieves details for a specific Card. + +```ts +async retrieveCard( + cardId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `cardId` | `string` | Template, Required | Unique ID for the desired Card. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveCardResponse`](../../doc/models/retrieve-card-response.md) + +## Example Usage + +```ts +const cardId = 'card_id4'; + +try { + const { result, ...httpResponse } = await cardsApi.retrieveCard(cardId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Disable Card + +Disables the card, preventing any further updates or charges. +Disabling an already disabled card is allowed but has no effect. + +```ts +async disableCard( + cardId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `cardId` | `string` | Template, Required | Unique ID for the desired Card. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`DisableCardResponse`](../../doc/models/disable-card-response.md) + +## Example Usage + +```ts +const cardId = 'card_id4'; + +try { + const { result, ...httpResponse } = await cardsApi.disableCard(cardId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/cash-drawers.md b/legacy/doc/api/cash-drawers.md new file mode 100644 index 000000000..fdafbe0ce --- /dev/null +++ b/legacy/doc/api/cash-drawers.md @@ -0,0 +1,166 @@ +# Cash Drawers + +```ts +const cashDrawersApi = client.cashDrawersApi; +``` + +## Class Name + +`CashDrawersApi` + +## Methods + +* [List Cash Drawer Shifts](../../doc/api/cash-drawers.md#list-cash-drawer-shifts) +* [Retrieve Cash Drawer Shift](../../doc/api/cash-drawers.md#retrieve-cash-drawer-shift) +* [List Cash Drawer Shift Events](../../doc/api/cash-drawers.md#list-cash-drawer-shift-events) + + +# List Cash Drawer Shifts + +Provides the details for all of the cash drawer shifts for a location +in a date range. + +```ts +async listCashDrawerShifts( + locationId: string, + sortOrder?: string, + beginTime?: string, + endTime?: string, + limit?: number, + cursor?: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string` | Query, Required | The ID of the location to query for a list of cash drawer shifts. | +| `sortOrder` | [`string \| undefined`](../../doc/models/sort-order.md) | Query, Optional | The order in which cash drawer shifts are listed in the response,
based on their opened_at field. Default value: ASC | +| `beginTime` | `string \| undefined` | Query, Optional | The inclusive start time of the query on opened_at, in ISO 8601 format. | +| `endTime` | `string \| undefined` | Query, Optional | The exclusive end date of the query on opened_at, in ISO 8601 format. | +| `limit` | `number \| undefined` | Query, Optional | Number of cash drawer shift events in a page of results (200 by
default, 1000 max). | +| `cursor` | `string \| undefined` | Query, Optional | Opaque cursor for fetching the next page of results. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListCashDrawerShiftsResponse`](../../doc/models/list-cash-drawer-shifts-response.md) + +## Example Usage + +```ts +const locationId = 'location_id4'; + +try { + const { result, ...httpResponse } = await cashDrawersApi.listCashDrawerShifts(locationId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Cash Drawer Shift + +Provides the summary details for a single cash drawer shift. See +[ListCashDrawerShiftEvents](../../doc/api/cash-drawers.md#list-cash-drawer-shift-events) for a list of cash drawer shift events. + +```ts +async retrieveCashDrawerShift( + locationId: string, + shiftId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string` | Query, Required | The ID of the location to retrieve cash drawer shifts from. | +| `shiftId` | `string` | Template, Required | The shift ID. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveCashDrawerShiftResponse`](../../doc/models/retrieve-cash-drawer-shift-response.md) + +## Example Usage + +```ts +const locationId = 'location_id4'; + +const shiftId = 'shift_id0'; + +try { + const { result, ...httpResponse } = await cashDrawersApi.retrieveCashDrawerShift( + locationId, + shiftId +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# List Cash Drawer Shift Events + +Provides a paginated list of events for a single cash drawer shift. + +```ts +async listCashDrawerShiftEvents( + locationId: string, + shiftId: string, + limit?: number, + cursor?: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string` | Query, Required | The ID of the location to list cash drawer shifts for. | +| `shiftId` | `string` | Template, Required | The shift ID. | +| `limit` | `number \| undefined` | Query, Optional | Number of resources to be returned in a page of results (200 by
default, 1000 max). | +| `cursor` | `string \| undefined` | Query, Optional | Opaque cursor for fetching the next page of results. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListCashDrawerShiftEventsResponse`](../../doc/models/list-cash-drawer-shift-events-response.md) + +## Example Usage + +```ts +const locationId = 'location_id4'; + +const shiftId = 'shift_id0'; + +try { + const { result, ...httpResponse } = await cashDrawersApi.listCashDrawerShiftEvents( + locationId, + shiftId +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/catalog.md b/legacy/doc/api/catalog.md new file mode 100644 index 000000000..65015c855 --- /dev/null +++ b/legacy/doc/api/catalog.md @@ -0,0 +1,936 @@ +# Catalog + +```ts +const catalogApi = client.catalogApi; +``` + +## Class Name + +`CatalogApi` + +## Methods + +* [Batch Delete Catalog Objects](../../doc/api/catalog.md#batch-delete-catalog-objects) +* [Batch Retrieve Catalog Objects](../../doc/api/catalog.md#batch-retrieve-catalog-objects) +* [Batch Upsert Catalog Objects](../../doc/api/catalog.md#batch-upsert-catalog-objects) +* [Create Catalog Image](../../doc/api/catalog.md#create-catalog-image) +* [Update Catalog Image](../../doc/api/catalog.md#update-catalog-image) +* [Catalog Info](../../doc/api/catalog.md#catalog-info) +* [List Catalog](../../doc/api/catalog.md#list-catalog) +* [Upsert Catalog Object](../../doc/api/catalog.md#upsert-catalog-object) +* [Delete Catalog Object](../../doc/api/catalog.md#delete-catalog-object) +* [Retrieve Catalog Object](../../doc/api/catalog.md#retrieve-catalog-object) +* [Search Catalog Objects](../../doc/api/catalog.md#search-catalog-objects) +* [Search Catalog Items](../../doc/api/catalog.md#search-catalog-items) +* [Update Item Modifier Lists](../../doc/api/catalog.md#update-item-modifier-lists) +* [Update Item Taxes](../../doc/api/catalog.md#update-item-taxes) + + +# Batch Delete Catalog Objects + +Deletes a set of [CatalogItem](../../doc/models/catalog-item.md)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](../../doc/models/catalog-item-variation.md) +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. + +```ts +async batchDeleteCatalogObjects( + body: BatchDeleteCatalogObjectsRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BatchDeleteCatalogObjectsRequest`](../../doc/models/batch-delete-catalog-objects-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`BatchDeleteCatalogObjectsResponse`](../../doc/models/batch-delete-catalog-objects-response.md) + +## Example Usage + +```ts +const body: BatchDeleteCatalogObjectsRequest = { + objectIds: [ + 'W62UWFY35CWMYGVWK6TWJDNI', + 'AA27W3M2GGTF3H6AVPNB77CK' + ], +}; + +try { + const { result, ...httpResponse } = await catalogApi.batchDeleteCatalogObjects(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Batch Retrieve Catalog Objects + +Returns a set of objects based on the provided ID. +Each [CatalogItem](../../doc/models/catalog-item.md) returned in the set includes all of its +child information including: all of its +[CatalogItemVariation](../../doc/models/catalog-item-variation.md) objects, references to +its [CatalogModifierList](../../doc/models/catalog-modifier-list.md) objects, and the ids of +any [CatalogTax](../../doc/models/catalog-tax.md) objects that apply to it. + +```ts +async batchRetrieveCatalogObjects( + body: BatchRetrieveCatalogObjectsRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BatchRetrieveCatalogObjectsRequest`](../../doc/models/batch-retrieve-catalog-objects-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`BatchRetrieveCatalogObjectsResponse`](../../doc/models/batch-retrieve-catalog-objects-response.md) + +## Example Usage + +```ts +const body: BatchRetrieveCatalogObjectsRequest = { + objectIds: [ + 'W62UWFY35CWMYGVWK6TWJDNI', + 'AA27W3M2GGTF3H6AVPNB77CK' + ], + includeRelatedObjects: true, +}; + +try { + const { result, ...httpResponse } = await catalogApi.batchRetrieveCatalogObjects(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Batch Upsert Catalog Objects + +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. + +```ts +async batchUpsertCatalogObjects( + body: BatchUpsertCatalogObjectsRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BatchUpsertCatalogObjectsRequest`](../../doc/models/batch-upsert-catalog-objects-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`BatchUpsertCatalogObjectsResponse`](../../doc/models/batch-upsert-catalog-objects-response.md) + +## Example Usage + +```ts +const body: BatchUpsertCatalogObjectsRequest = { + idempotencyKey: '789ff020-f723-43a9-b4b5-43b5dc1fa3dc', + batches: [ + { + objects: [ + { + type: 'ITEM', + id: '#Tea', + presentAtAllLocations: true, + itemData: { + name: 'Tea', + taxIds: [ + '#SalesTax' + ], + variations: [ + { + type: 'ITEM_VARIATION', + id: '#Tea_Mug', + presentAtAllLocations: true, + itemVariationData: { + itemId: '#Tea', + name: 'Mug', + pricingType: 'FIXED_PRICING', + priceMoney: { + amount: BigInt(150), + currency: 'USD', + }, + }, + } + ], + categories: [ + { + id: '#Beverages', + } + ], + descriptionHtml: '

Hot Leaf Juice

', + }, + }, + { + type: 'ITEM', + id: '#Coffee', + presentAtAllLocations: true, + itemData: { + name: 'Coffee', + taxIds: [ + '#SalesTax' + ], + variations: [ + { + type: 'ITEM_VARIATION', + id: '#Coffee_Regular', + presentAtAllLocations: true, + itemVariationData: { + itemId: '#Coffee', + name: 'Regular', + pricingType: 'FIXED_PRICING', + priceMoney: { + amount: BigInt(250), + currency: 'USD', + }, + }, + }, + { + type: 'ITEM_VARIATION', + id: '#Coffee_Large', + presentAtAllLocations: true, + itemVariationData: { + itemId: '#Coffee', + name: 'Large', + pricingType: 'FIXED_PRICING', + priceMoney: { + amount: BigInt(350), + currency: 'USD', + }, + }, + } + ], + categories: [ + { + id: '#Beverages', + } + ], + descriptionHtml: '

Hot Bean Juice

', + }, + }, + { + type: 'CATEGORY', + id: '#Beverages', + presentAtAllLocations: true, + categoryData: { + name: 'Beverages', + }, + }, + { + type: 'TAX', + id: '#SalesTax', + presentAtAllLocations: true, + taxData: { + name: 'Sales Tax', + calculationPhase: 'TAX_SUBTOTAL_PHASE', + inclusionType: 'ADDITIVE', + percentage: '5.0', + appliesToCustomAmounts: true, + enabled: true, + }, + } + ], + } + ], +}; + +try { + const { result, ...httpResponse } = await catalogApi.batchUpsertCatalogObjects(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Create Catalog Image + +Uploads an image file to be represented by a [CatalogImage](../../doc/models/catalog-image.md) object that can be linked to an existing +[CatalogObject](../../doc/models/catalog-object.md) 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. + +```ts +async createCatalogImage( + request?: CreateCatalogImageRequest, + imageFile?: FileWrapper, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `request` | [`CreateCatalogImageRequest \| undefined`](../../doc/models/create-catalog-image-request.md) | Form (JSON-Encoded), Optional | - | +| `imageFile` | `FileWrapper \| undefined` | Form, Optional | - | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CreateCatalogImageResponse`](../../doc/models/create-catalog-image-response.md) + +## Example Usage + +```ts +const request: CreateCatalogImageRequest = { + idempotencyKey: '528dea59-7bfb-43c1-bd48-4a6bba7dd61f86', + image: { + type: 'IMAGE', + id: '#TEMP_ID', + imageData: { + caption: 'A picture of a cup of coffee', + }, + }, + objectId: 'ND6EA5AAJEO5WL3JNNIAQA32', +}; + +try { + const { result, ...httpResponse } = await catalogApi.createCatalogImage(request); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Update Catalog Image + +Uploads a new image file to replace the existing one in the specified [CatalogImage](../../doc/models/catalog-image.md) 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. + +```ts +async updateCatalogImage( + imageId: string, + request?: UpdateCatalogImageRequest, + imageFile?: FileWrapper, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `imageId` | `string` | Template, Required | The ID of the `CatalogImage` object to update the encapsulated image file. | +| `request` | [`UpdateCatalogImageRequest \| undefined`](../../doc/models/update-catalog-image-request.md) | Form (JSON-Encoded), Optional | - | +| `imageFile` | `FileWrapper \| undefined` | Form, Optional | - | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`UpdateCatalogImageResponse`](../../doc/models/update-catalog-image-response.md) + +## Example Usage + +```ts +const imageId = 'image_id4'; + +const request: UpdateCatalogImageRequest = { + idempotencyKey: '528dea59-7bfb-43c1-bd48-4a6bba7dd61f86', +}; + +try { + const { result, ...httpResponse } = await catalogApi.updateCatalogImage( + imageId, + request +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Catalog Info + +Retrieves information about the Square Catalog API, such as batch size +limits that can be used by the `BatchUpsertCatalogObjects` endpoint. + +```ts +async catalogInfo( + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CatalogInfoResponse`](../../doc/models/catalog-info-response.md) + +## Example Usage + +```ts +try { + const { result, ...httpResponse } = await catalogApi.catalogInfo(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# List Catalog + +Returns a list of all [CatalogObject](../../doc/models/catalog-object.md)s of the specified types in the catalog. + +The `types` parameter is specified as a comma-separated list of the [CatalogObjectType](../../doc/models/catalog-object-type.md) 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](../../doc/api/catalog.md#search-catalog-objects) +and set the `include_deleted_objects` attribute value to `true`. + +```ts +async listCatalog( + cursor?: string, + types?: string, + catalogVersion?: bigint, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `cursor` | `string \| undefined` | Query, Optional | 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` | `string \| undefined` | Query, Optional | 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. | +| `catalogVersion` | `bigint \| undefined` | Query, Optional | 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](../../doc/models/catalog-object.md)s' `version` attribute. If not included, results will be from the
current version of the catalog. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListCatalogResponse`](../../doc/models/list-catalog-response.md) + +## Example Usage + +```ts +try { + const { result, ...httpResponse } = await catalogApi.listCatalog(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Upsert Catalog Object + +Creates a new or updates the specified [CatalogObject](../../doc/models/catalog-object.md). + +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. + +```ts +async upsertCatalogObject( + body: UpsertCatalogObjectRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`UpsertCatalogObjectRequest`](../../doc/models/upsert-catalog-object-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`UpsertCatalogObjectResponse`](../../doc/models/upsert-catalog-object-response.md) + +## Example Usage + +```ts +const body: UpsertCatalogObjectRequest = { + idempotencyKey: 'af3d1afc-7212-4300-b463-0bfc5314a5ae', + object: { + type: 'ITEM', + id: '#Cocoa', + itemData: { + name: 'Cocoa', + abbreviation: 'Ch', + variations: [ + { + type: 'ITEM_VARIATION', + id: '#Small', + itemVariationData: { + itemId: '#Cocoa', + name: 'Small', + pricingType: 'VARIABLE_PRICING', + }, + }, + { + type: 'ITEM_VARIATION', + id: '#Large', + itemVariationData: { + itemId: '#Cocoa', + name: 'Large', + pricingType: 'FIXED_PRICING', + priceMoney: { + amount: BigInt(400), + currency: 'USD', + }, + }, + } + ], + descriptionHtml: '

Hot Chocolate

', + }, + }, +}; + +try { + const { result, ...httpResponse } = await catalogApi.upsertCatalogObject(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Delete Catalog Object + +Deletes a single [CatalogObject](../../doc/models/catalog-object.md) 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](../../doc/models/catalog-item.md) +will also delete all of its +[CatalogItemVariation](../../doc/models/catalog-item-variation.md) 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. + +```ts +async deleteCatalogObject( + objectId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `objectId` | `string` | Template, Required | 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). | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`DeleteCatalogObjectResponse`](../../doc/models/delete-catalog-object-response.md) + +## Example Usage + +```ts +const objectId = 'object_id8'; + +try { + const { result, ...httpResponse } = await catalogApi.deleteCatalogObject(objectId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Catalog Object + +Returns a single [CatalogItem](../../doc/models/catalog-item.md) as a +[CatalogObject](../../doc/models/catalog-object.md) based on the provided ID. The returned +object includes all of the relevant [CatalogItem](../../doc/models/catalog-item.md) +information including: [CatalogItemVariation](../../doc/models/catalog-item-variation.md) +children, references to its +[CatalogModifierList](../../doc/models/catalog-modifier-list.md) objects, and the ids of +any [CatalogTax](../../doc/models/catalog-tax.md) objects that apply to it. + +```ts +async retrieveCatalogObject( + objectId: string, + includeRelatedObjects?: boolean, + catalogVersion?: bigint, + includeCategoryPathToRoot?: boolean, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `objectId` | `string` | Template, Required | The object ID of any type of catalog objects to be retrieved. | +| `includeRelatedObjects` | `boolean \| undefined` | Query, Optional | 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`
**Default**: `false` | +| `catalogVersion` | `bigint \| undefined` | Query, Optional | 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](../../doc/models/catalog-object.md)s. If not included, results will
be from the current version of the catalog. | +| `includeCategoryPathToRoot` | `boolean \| undefined` | Query, Optional | 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.
**Default**: `false` | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveCatalogObjectResponse`](../../doc/models/retrieve-catalog-object-response.md) + +## Example Usage + +```ts +const objectId = 'object_id8'; + +const includeRelatedObjects = false; + +const includeCategoryPathToRoot = false; + +try { + const { result, ...httpResponse } = await catalogApi.retrieveCatalogObject( + objectId, + includeRelatedObjects, + undefined, + includeCategoryPathToRoot +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Search Catalog Objects + +Searches for [CatalogObject](../../doc/models/catalog-object.md) 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](../../doc/api/catalog.md#search-catalog-items) +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. + +```ts +async searchCatalogObjects( + body: SearchCatalogObjectsRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`SearchCatalogObjectsRequest`](../../doc/models/search-catalog-objects-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`SearchCatalogObjectsResponse`](../../doc/models/search-catalog-objects-response.md) + +## Example Usage + +```ts +const body: SearchCatalogObjectsRequest = { + objectTypes: [ + 'ITEM' + ], + query: { + prefixQuery: { + attributeName: 'name', + attributePrefix: 'tea', + }, + }, + limit: 100, +}; + +try { + const { result, ...httpResponse } = await catalogApi.searchCatalogObjects(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Search Catalog Items + +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](../../doc/api/catalog.md#search-catalog-objects) +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. + +```ts +async searchCatalogItems( + body: SearchCatalogItemsRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`SearchCatalogItemsRequest`](../../doc/models/search-catalog-items-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`SearchCatalogItemsResponse`](../../doc/models/search-catalog-items-response.md) + +## Example Usage + +```ts +const body: SearchCatalogItemsRequest = { + textFilter: 'red', + categoryIds: [ + 'WINE_CATEGORY_ID' + ], + stockLevels: [ + 'OUT', + 'LOW' + ], + enabledLocationIds: [ + 'ATL_LOCATION_ID' + ], + limit: 100, + sortOrder: 'ASC', + productTypes: [ + 'REGULAR' + ], + customAttributeFilters: [ + { + customAttributeDefinitionId: 'VEGAN_DEFINITION_ID', + boolFilter: true, + }, + { + customAttributeDefinitionId: 'BRAND_DEFINITION_ID', + stringFilter: 'Dark Horse', + }, + { + key: 'VINTAGE', + numberFilter: { + min: '2017', + max: '2018', + }, + }, + { + customAttributeDefinitionId: 'VARIETAL_DEFINITION_ID', + } + ], +}; + +try { + const { result, ...httpResponse } = await catalogApi.searchCatalogItems(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Update Item Modifier Lists + +Updates the [CatalogModifierList](../../doc/models/catalog-modifier-list.md) objects +that apply to the targeted [CatalogItem](../../doc/models/catalog-item.md) without having +to perform an upsert on the entire item. + +```ts +async updateItemModifierLists( + body: UpdateItemModifierListsRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`UpdateItemModifierListsRequest`](../../doc/models/update-item-modifier-lists-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`UpdateItemModifierListsResponse`](../../doc/models/update-item-modifier-lists-response.md) + +## Example Usage + +```ts +const body: UpdateItemModifierListsRequest = { + itemIds: [ + 'H42BRLUJ5KTZTTMPVSLFAACQ', + '2JXOBJIHCWBQ4NZ3RIXQGJA6' + ], + modifierListsToEnable: [ + 'H42BRLUJ5KTZTTMPVSLFAACQ', + '2JXOBJIHCWBQ4NZ3RIXQGJA6' + ], + modifierListsToDisable: [ + '7WRC16CJZDVLSNDQ35PP6YAD' + ], +}; + +try { + const { result, ...httpResponse } = await catalogApi.updateItemModifierLists(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Update Item Taxes + +Updates the [CatalogTax](../../doc/models/catalog-tax.md) objects that apply to the +targeted [CatalogItem](../../doc/models/catalog-item.md) without having to perform an +upsert on the entire item. + +```ts +async updateItemTaxes( + body: UpdateItemTaxesRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`UpdateItemTaxesRequest`](../../doc/models/update-item-taxes-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`UpdateItemTaxesResponse`](../../doc/models/update-item-taxes-response.md) + +## Example Usage + +```ts +const body: UpdateItemTaxesRequest = { + itemIds: [ + 'H42BRLUJ5KTZTTMPVSLFAACQ', + '2JXOBJIHCWBQ4NZ3RIXQGJA6' + ], + taxesToEnable: [ + '4WRCNHCJZDVLSNDQ35PP6YAD' + ], + taxesToDisable: [ + 'AQCEGCEBBQONINDOHRGZISEX' + ], +}; + +try { + const { result, ...httpResponse } = await catalogApi.updateItemTaxes(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/checkout.md b/legacy/doc/api/checkout.md new file mode 100644 index 000000000..47f9faafc --- /dev/null +++ b/legacy/doc/api/checkout.md @@ -0,0 +1,561 @@ +# Checkout + +```ts +const checkoutApi = client.checkoutApi; +``` + +## Class Name + +`CheckoutApi` + +## Methods + +* [Create Checkout](../../doc/api/checkout.md#create-checkout) +* [Retrieve Location Settings](../../doc/api/checkout.md#retrieve-location-settings) +* [Update Location Settings](../../doc/api/checkout.md#update-location-settings) +* [Retrieve Merchant Settings](../../doc/api/checkout.md#retrieve-merchant-settings) +* [Update Merchant Settings](../../doc/api/checkout.md#update-merchant-settings) +* [List Payment Links](../../doc/api/checkout.md#list-payment-links) +* [Create Payment Link](../../doc/api/checkout.md#create-payment-link) +* [Delete Payment Link](../../doc/api/checkout.md#delete-payment-link) +* [Retrieve Payment Link](../../doc/api/checkout.md#retrieve-payment-link) +* [Update Payment Link](../../doc/api/checkout.md#update-payment-link) + + +# Create Checkout + +**This endpoint is deprecated.** + +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). + +```ts +async createCheckout( + locationId: string, + body: CreateCheckoutRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string` | Template, Required | The ID of the business location to associate the checkout with. | +| `body` | [`CreateCheckoutRequest`](../../doc/models/create-checkout-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CreateCheckoutResponse`](../../doc/models/create-checkout-response.md) + +## Example Usage + +```ts +const locationId = 'location_id4'; + +const body: CreateCheckoutRequest = { + idempotencyKey: '86ae1696-b1e3-4328-af6d-f1e04d947ad6', + order: { + order: { + locationId: 'location_id', + referenceId: 'reference_id', + customerId: 'customer_id', + lineItems: [ + { + quantity: '2', + name: 'Printed T Shirt', + appliedTaxes: [ + { + taxUid: '38ze1696-z1e3-5628-af6d-f1e04d947fg3', + } + ], + appliedDiscounts: [ + { + discountUid: '56ae1696-z1e3-9328-af6d-f1e04d947gd4', + } + ], + basePriceMoney: { + amount: BigInt(1500), + currency: 'USD', + }, + }, + { + quantity: '1', + name: 'Slim Jeans', + basePriceMoney: { + amount: BigInt(2500), + currency: 'USD', + }, + }, + { + quantity: '3', + name: 'Woven Sweater', + basePriceMoney: { + amount: BigInt(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', + amountMoney: { + amount: BigInt(100), + currency: 'USD', + }, + scope: 'LINE_ITEM', + } + ], + }, + idempotencyKey: '12ae1696-z1e3-4328-af6d-f1e04d947gd4', + }, + askForShippingAddress: true, + merchantSupportEmail: 'merchant+support@website.com', + prePopulateBuyerEmail: 'example@email.com', + prePopulateShippingAddress: { + addressLine1: '1455 Market St.', + addressLine2: 'Suite 600', + locality: 'San Francisco', + administrativeDistrictLevel1: 'CA', + postalCode: '94103', + country: 'US', + firstName: 'Jane', + lastName: 'Doe', + }, + redirectUrl: 'https://merchant.website.com/order-confirm', + additionalRecipients: [ + { + locationId: '057P5VYJ4A5X1', + description: 'Application fees', + amountMoney: { + amount: BigInt(60), + currency: 'USD', + }, + } + ], +}; + +try { + const { result, ...httpResponse } = await checkoutApi.createCheckout( + locationId, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Location Settings + +Retrieves the location-level settings for a Square-hosted checkout page. + +```ts +async retrieveLocationSettings( + locationId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string` | Template, Required | The ID of the location for which to retrieve settings. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveLocationSettingsResponse`](../../doc/models/retrieve-location-settings-response.md) + +## Example Usage + +```ts +const locationId = 'location_id4'; + +try { + const { result, ...httpResponse } = await checkoutApi.retrieveLocationSettings(locationId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Update Location Settings + +Updates the location-level settings for a Square-hosted checkout page. + +```ts +async updateLocationSettings( + locationId: string, + body: UpdateLocationSettingsRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string` | Template, Required | The ID of the location for which to retrieve settings. | +| `body` | [`UpdateLocationSettingsRequest`](../../doc/models/update-location-settings-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`UpdateLocationSettingsResponse`](../../doc/models/update-location-settings-response.md) + +## Example Usage + +```ts +const locationId = 'location_id4'; + +const body: UpdateLocationSettingsRequest = { + locationSettings: { + }, +}; + +try { + const { result, ...httpResponse } = await checkoutApi.updateLocationSettings( + locationId, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Merchant Settings + +Retrieves the merchant-level settings for a Square-hosted checkout page. + +```ts +async retrieveMerchantSettings( + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveMerchantSettingsResponse`](../../doc/models/retrieve-merchant-settings-response.md) + +## Example Usage + +```ts +try { + const { result, ...httpResponse } = await checkoutApi.retrieveMerchantSettings(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Update Merchant Settings + +Updates the merchant-level settings for a Square-hosted checkout page. + +```ts +async updateMerchantSettings( + body: UpdateMerchantSettingsRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`UpdateMerchantSettingsRequest`](../../doc/models/update-merchant-settings-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`UpdateMerchantSettingsResponse`](../../doc/models/update-merchant-settings-response.md) + +## Example Usage + +```ts +const body: UpdateMerchantSettingsRequest = { + merchantSettings: { + }, +}; + +try { + const { result, ...httpResponse } = await checkoutApi.updateMerchantSettings(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# List Payment Links + +Lists all payment links. + +```ts +async listPaymentLinks( + cursor?: string, + limit?: number, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `cursor` | `string \| undefined` | Query, Optional | 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` | `number \| undefined` | Query, Optional | 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` | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListPaymentLinksResponse`](../../doc/models/list-payment-links-response.md) + +## Example Usage + +```ts +try { + const { result, ...httpResponse } = await checkoutApi.listPaymentLinks(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Create Payment Link + +Creates a Square-hosted checkout page. Applications can share the resulting payment link with their buyer to pay for goods and services. + +```ts +async createPaymentLink( + body: CreatePaymentLinkRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`CreatePaymentLinkRequest`](../../doc/models/create-payment-link-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CreatePaymentLinkResponse`](../../doc/models/create-payment-link-response.md) + +## Example Usage + +```ts +const body: CreatePaymentLinkRequest = { + idempotencyKey: 'cd9e25dc-d9f2-4430-aedb-61605070e95f', + quickPay: { + name: 'Auto Detailing', + priceMoney: { + amount: BigInt(10000), + currency: 'USD', + }, + locationId: 'A9Y43N9ABXZBP', + }, +}; + +try { + const { result, ...httpResponse } = await checkoutApi.createPaymentLink(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Delete Payment Link + +Deletes a payment link. + +```ts +async deletePaymentLink( + id: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string` | Template, Required | The ID of the payment link to delete. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`DeletePaymentLinkResponse`](../../doc/models/delete-payment-link-response.md) + +## Example Usage + +```ts +const id = 'id0'; + +try { + const { result, ...httpResponse } = await checkoutApi.deletePaymentLink(id); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Payment Link + +Retrieves a payment link. + +```ts +async retrievePaymentLink( + id: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string` | Template, Required | The ID of link to retrieve. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrievePaymentLinkResponse`](../../doc/models/retrieve-payment-link-response.md) + +## Example Usage + +```ts +const id = 'id0'; + +try { + const { result, ...httpResponse } = await checkoutApi.retrievePaymentLink(id); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Update Payment Link + +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. + +```ts +async updatePaymentLink( + id: string, + body: UpdatePaymentLinkRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string` | Template, Required | The ID of the payment link to update. | +| `body` | [`UpdatePaymentLinkRequest`](../../doc/models/update-payment-link-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`UpdatePaymentLinkResponse`](../../doc/models/update-payment-link-response.md) + +## Example Usage + +```ts +const id = 'id0'; + +const body: UpdatePaymentLinkRequest = { + paymentLink: { + version: 1, + checkoutOptions: { + askForShippingAddress: true, + }, + }, +}; + +try { + const { result, ...httpResponse } = await checkoutApi.updatePaymentLink( + id, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/customer-custom-attributes.md b/legacy/doc/api/customer-custom-attributes.md new file mode 100644 index 000000000..b6c2b9b96 --- /dev/null +++ b/legacy/doc/api/customer-custom-attributes.md @@ -0,0 +1,575 @@ +# Customer Custom Attributes + +```ts +const customerCustomAttributesApi = client.customerCustomAttributesApi; +``` + +## Class Name + +`CustomerCustomAttributesApi` + +## Methods + +* [List Customer Custom Attribute Definitions](../../doc/api/customer-custom-attributes.md#list-customer-custom-attribute-definitions) +* [Create Customer Custom Attribute Definition](../../doc/api/customer-custom-attributes.md#create-customer-custom-attribute-definition) +* [Delete Customer Custom Attribute Definition](../../doc/api/customer-custom-attributes.md#delete-customer-custom-attribute-definition) +* [Retrieve Customer Custom Attribute Definition](../../doc/api/customer-custom-attributes.md#retrieve-customer-custom-attribute-definition) +* [Update Customer Custom Attribute Definition](../../doc/api/customer-custom-attributes.md#update-customer-custom-attribute-definition) +* [Bulk Upsert Customer Custom Attributes](../../doc/api/customer-custom-attributes.md#bulk-upsert-customer-custom-attributes) +* [List Customer Custom Attributes](../../doc/api/customer-custom-attributes.md#list-customer-custom-attributes) +* [Delete Customer Custom Attribute](../../doc/api/customer-custom-attributes.md#delete-customer-custom-attribute) +* [Retrieve Customer Custom Attribute](../../doc/api/customer-custom-attributes.md#retrieve-customer-custom-attribute) +* [Upsert Customer Custom Attribute](../../doc/api/customer-custom-attributes.md#upsert-customer-custom-attribute) + + +# List Customer Custom Attribute Definitions + +Lists the customer-related [custom attribute definitions](../../doc/models/custom-attribute-definition.md) 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`. + +```ts +async listCustomerCustomAttributeDefinitions( + limit?: number, + cursor?: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `limit` | `number \| undefined` | Query, Optional | 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` | `string \| undefined` | Query, Optional | 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). | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListCustomerCustomAttributeDefinitionsResponse`](../../doc/models/list-customer-custom-attribute-definitions-response.md) + +## Example Usage + +```ts +try { + const { result, ...httpResponse } = await customerCustomAttributesApi.listCustomerCustomAttributeDefinitions(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Create Customer Custom Attribute Definition + +Creates a customer-related [custom attribute definition](../../doc/models/custom-attribute-definition.md) 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](../../doc/api/customer-custom-attributes.md#upsert-customer-custom-attribute) or +[BulkUpsertCustomerCustomAttributes](../../doc/api/customer-custom-attributes.md#bulk-upsert-customer-custom-attributes) +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`. + +```ts +async createCustomerCustomAttributeDefinition( + body: CreateCustomerCustomAttributeDefinitionRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`CreateCustomerCustomAttributeDefinitionRequest`](../../doc/models/create-customer-custom-attribute-definition-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CreateCustomerCustomAttributeDefinitionResponse`](../../doc/models/create-customer-custom-attribute-definition-response.md) + +## Example Usage + +```ts +const body: CreateCustomerCustomAttributeDefinitionRequest = { + customAttributeDefinition: { + key: 'favoritemovie', + name: 'Favorite Movie', + description: 'The favorite movie of the customer.', + visibility: 'VISIBILITY_HIDDEN', + }, +}; + +try { + const { result, ...httpResponse } = await customerCustomAttributesApi.createCustomerCustomAttributeDefinition(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Delete Customer Custom Attribute Definition + +Deletes a customer-related [custom attribute definition](../../doc/models/custom-attribute-definition.md) 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. + +```ts +async deleteCustomerCustomAttributeDefinition( + key: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `key` | `string` | Template, Required | The key of the custom attribute definition to delete. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`DeleteCustomerCustomAttributeDefinitionResponse`](../../doc/models/delete-customer-custom-attribute-definition-response.md) + +## Example Usage + +```ts +const key = 'key0'; + +try { + const { result, ...httpResponse } = await customerCustomAttributesApi.deleteCustomerCustomAttributeDefinition(key); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Customer Custom Attribute Definition + +Retrieves a customer-related [custom attribute definition](../../doc/models/custom-attribute-definition.md) 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`. + +```ts +async retrieveCustomerCustomAttributeDefinition( + key: string, + version?: number, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `key` | `string` | Template, Required | The key of the custom attribute definition to retrieve. If the requesting application
is not the definition owner, you must use the qualified key. | +| `version` | `number \| undefined` | Query, Optional | 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. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveCustomerCustomAttributeDefinitionResponse`](../../doc/models/retrieve-customer-custom-attribute-definition-response.md) + +## Example Usage + +```ts +const key = 'key0'; + +try { + const { result, ...httpResponse } = await customerCustomAttributesApi.retrieveCustomerCustomAttributeDefinition(key); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Update Customer Custom Attribute Definition + +Updates a customer-related [custom attribute definition](../../doc/models/custom-attribute-definition.md) 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`. + +```ts +async updateCustomerCustomAttributeDefinition( + key: string, + body: UpdateCustomerCustomAttributeDefinitionRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `key` | `string` | Template, Required | The key of the custom attribute definition to update. | +| `body` | [`UpdateCustomerCustomAttributeDefinitionRequest`](../../doc/models/update-customer-custom-attribute-definition-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`UpdateCustomerCustomAttributeDefinitionResponse`](../../doc/models/update-customer-custom-attribute-definition-response.md) + +## Example Usage + +```ts +const key = 'key0'; + +const body: UpdateCustomerCustomAttributeDefinitionRequest = { + customAttributeDefinition: { + description: 'Update the description as desired.', + visibility: 'VISIBILITY_READ_ONLY', + }, +}; + +try { + const { result, ...httpResponse } = await customerCustomAttributesApi.updateCustomerCustomAttributeDefinition( + key, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Bulk Upsert Customer Custom Attributes + +Creates or updates [custom attributes](../../doc/models/custom-attribute.md) 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](../../doc/api/customer-custom-attributes.md#create-customer-custom-attribute-definition) 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`. + +```ts +async bulkUpsertCustomerCustomAttributes( + body: BulkUpsertCustomerCustomAttributesRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BulkUpsertCustomerCustomAttributesRequest`](../../doc/models/bulk-upsert-customer-custom-attributes-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`BulkUpsertCustomerCustomAttributesResponse`](../../doc/models/bulk-upsert-customer-custom-attributes-response.md) + +## Example Usage + +```ts +const body: BulkUpsertCustomerCustomAttributesRequest = { + values: { + 'key0': { + customerId: 'customer_id8', + customAttribute: { + }, + }, + 'key1': { + customerId: 'customer_id8', + customAttribute: { + }, + } + }, +}; + +try { + const { result, ...httpResponse } = await customerCustomAttributesApi.bulkUpsertCustomerCustomAttributes(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# List Customer Custom Attributes + +Lists the [custom attributes](../../doc/models/custom-attribute.md) 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`. + +```ts +async listCustomerCustomAttributes( + customerId: string, + limit?: number, + cursor?: string, + withDefinitions?: boolean, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `customerId` | `string` | Template, Required | The ID of the target [customer profile](entity:Customer). | +| `limit` | `number \| undefined` | Query, Optional | 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` | `string \| undefined` | Query, Optional | 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). | +| `withDefinitions` | `boolean \| undefined` | Query, Optional | 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`.
**Default**: `false` | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListCustomerCustomAttributesResponse`](../../doc/models/list-customer-custom-attributes-response.md) + +## Example Usage + +```ts +const customerId = 'customer_id8'; + +const withDefinitions = false; + +try { + const { result, ...httpResponse } = await customerCustomAttributesApi.listCustomerCustomAttributes( + customerId, + undefined, + undefined, + withDefinitions +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Delete Customer Custom Attribute + +Deletes a [custom attribute](../../doc/models/custom-attribute.md) 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`. + +```ts +async deleteCustomerCustomAttribute( + customerId: string, + key: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `customerId` | `string` | Template, Required | The ID of the target [customer profile](entity:Customer). | +| `key` | `string` | Template, Required | 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. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`DeleteCustomerCustomAttributeResponse`](../../doc/models/delete-customer-custom-attribute-response.md) + +## Example Usage + +```ts +const customerId = 'customer_id8'; + +const key = 'key0'; + +try { + const { result, ...httpResponse } = await customerCustomAttributesApi.deleteCustomerCustomAttribute( + customerId, + key +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Customer Custom Attribute + +Retrieves a [custom attribute](../../doc/models/custom-attribute.md) 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`. + +```ts +async retrieveCustomerCustomAttribute( + customerId: string, + key: string, + withDefinition?: boolean, + version?: number, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `customerId` | `string` | Template, Required | The ID of the target [customer profile](entity:Customer). | +| `key` | `string` | Template, Required | 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. | +| `withDefinition` | `boolean \| undefined` | Query, Optional | 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`.
**Default**: `false` | +| `version` | `number \| undefined` | Query, Optional | 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. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveCustomerCustomAttributeResponse`](../../doc/models/retrieve-customer-custom-attribute-response.md) + +## Example Usage + +```ts +const customerId = 'customer_id8'; + +const key = 'key0'; + +const withDefinition = false; + +try { + const { result, ...httpResponse } = await customerCustomAttributesApi.retrieveCustomerCustomAttribute( + customerId, + key, + withDefinition +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Upsert Customer Custom Attribute + +Creates or updates a [custom attribute](../../doc/models/custom-attribute.md) 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](../../doc/api/customer-custom-attributes.md#create-customer-custom-attribute-definition) 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`. + +```ts +async upsertCustomerCustomAttribute( + customerId: string, + key: string, + body: UpsertCustomerCustomAttributeRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `customerId` | `string` | Template, Required | The ID of the target [customer profile](entity:Customer). | +| `key` | `string` | Template, Required | 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` | [`UpsertCustomerCustomAttributeRequest`](../../doc/models/upsert-customer-custom-attribute-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`UpsertCustomerCustomAttributeResponse`](../../doc/models/upsert-customer-custom-attribute-response.md) + +## Example Usage + +```ts +const customerId = 'customer_id8'; + +const key = 'key0'; + +const body: UpsertCustomerCustomAttributeRequest = { + customAttribute: { + }, +}; + +try { + const { result, ...httpResponse } = await customerCustomAttributesApi.upsertCustomerCustomAttribute( + customerId, + key, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/customer-groups.md b/legacy/doc/api/customer-groups.md new file mode 100644 index 000000000..0fd88d68b --- /dev/null +++ b/legacy/doc/api/customer-groups.md @@ -0,0 +1,235 @@ +# Customer Groups + +```ts +const customerGroupsApi = client.customerGroupsApi; +``` + +## Class Name + +`CustomerGroupsApi` + +## Methods + +* [List Customer Groups](../../doc/api/customer-groups.md#list-customer-groups) +* [Create Customer Group](../../doc/api/customer-groups.md#create-customer-group) +* [Delete Customer Group](../../doc/api/customer-groups.md#delete-customer-group) +* [Retrieve Customer Group](../../doc/api/customer-groups.md#retrieve-customer-group) +* [Update Customer Group](../../doc/api/customer-groups.md#update-customer-group) + + +# List Customer Groups + +Retrieves the list of customer groups of a business. + +```ts +async listCustomerGroups( + cursor?: string, + limit?: number, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `cursor` | `string \| undefined` | Query, Optional | 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` | `number \| undefined` | Query, Optional | 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). | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListCustomerGroupsResponse`](../../doc/models/list-customer-groups-response.md) + +## Example Usage + +```ts +try { + const { result, ...httpResponse } = await customerGroupsApi.listCustomerGroups(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Create Customer Group + +Creates a new customer group for a business. + +The request must include the `name` value of the group. + +```ts +async createCustomerGroup( + body: CreateCustomerGroupRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`CreateCustomerGroupRequest`](../../doc/models/create-customer-group-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CreateCustomerGroupResponse`](../../doc/models/create-customer-group-response.md) + +## Example Usage + +```ts +const body: CreateCustomerGroupRequest = { + group: { + name: 'Loyal Customers', + }, +}; + +try { + const { result, ...httpResponse } = await customerGroupsApi.createCustomerGroup(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Delete Customer Group + +Deletes a customer group as identified by the `group_id` value. + +```ts +async deleteCustomerGroup( + groupId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `groupId` | `string` | Template, Required | The ID of the customer group to delete. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`DeleteCustomerGroupResponse`](../../doc/models/delete-customer-group-response.md) + +## Example Usage + +```ts +const groupId = 'group_id0'; + +try { + const { result, ...httpResponse } = await customerGroupsApi.deleteCustomerGroup(groupId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Customer Group + +Retrieves a specific customer group as identified by the `group_id` value. + +```ts +async retrieveCustomerGroup( + groupId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `groupId` | `string` | Template, Required | The ID of the customer group to retrieve. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveCustomerGroupResponse`](../../doc/models/retrieve-customer-group-response.md) + +## Example Usage + +```ts +const groupId = 'group_id0'; + +try { + const { result, ...httpResponse } = await customerGroupsApi.retrieveCustomerGroup(groupId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Update Customer Group + +Updates a customer group as identified by the `group_id` value. + +```ts +async updateCustomerGroup( + groupId: string, + body: UpdateCustomerGroupRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `groupId` | `string` | Template, Required | The ID of the customer group to update. | +| `body` | [`UpdateCustomerGroupRequest`](../../doc/models/update-customer-group-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`UpdateCustomerGroupResponse`](../../doc/models/update-customer-group-response.md) + +## Example Usage + +```ts +const groupId = 'group_id0'; + +const body: UpdateCustomerGroupRequest = { + group: { + name: 'Loyal Customers', + }, +}; + +try { + const { result, ...httpResponse } = await customerGroupsApi.updateCustomerGroup( + groupId, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/customer-segments.md b/legacy/doc/api/customer-segments.md new file mode 100644 index 000000000..01e1370da --- /dev/null +++ b/legacy/doc/api/customer-segments.md @@ -0,0 +1,95 @@ +# Customer Segments + +```ts +const customerSegmentsApi = client.customerSegmentsApi; +``` + +## Class Name + +`CustomerSegmentsApi` + +## Methods + +* [List Customer Segments](../../doc/api/customer-segments.md#list-customer-segments) +* [Retrieve Customer Segment](../../doc/api/customer-segments.md#retrieve-customer-segment) + + +# List Customer Segments + +Retrieves the list of customer segments of a business. + +```ts +async listCustomerSegments( + cursor?: string, + limit?: number, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `cursor` | `string \| undefined` | Query, Optional | 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` | `number \| undefined` | Query, Optional | 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). | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListCustomerSegmentsResponse`](../../doc/models/list-customer-segments-response.md) + +## Example Usage + +```ts +try { + const { result, ...httpResponse } = await customerSegmentsApi.listCustomerSegments(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Customer Segment + +Retrieves a specific customer segment as identified by the `segment_id` value. + +```ts +async retrieveCustomerSegment( + segmentId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `segmentId` | `string` | Template, Required | The Square-issued ID of the customer segment. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveCustomerSegmentResponse`](../../doc/models/retrieve-customer-segment-response.md) + +## Example Usage + +```ts +const segmentId = 'segment_id4'; + +try { + const { result, ...httpResponse } = await customerSegmentsApi.retrieveCustomerSegment(segmentId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/customers.md b/legacy/doc/api/customers.md new file mode 100644 index 000000000..b6ac01988 --- /dev/null +++ b/legacy/doc/api/customers.md @@ -0,0 +1,818 @@ +# Customers + +```ts +const customersApi = client.customersApi; +``` + +## Class Name + +`CustomersApi` + +## Methods + +* [List Customers](../../doc/api/customers.md#list-customers) +* [Create Customer](../../doc/api/customers.md#create-customer) +* [Bulk Create Customers](../../doc/api/customers.md#bulk-create-customers) +* [Bulk Delete Customers](../../doc/api/customers.md#bulk-delete-customers) +* [Bulk Retrieve Customers](../../doc/api/customers.md#bulk-retrieve-customers) +* [Bulk Update Customers](../../doc/api/customers.md#bulk-update-customers) +* [Search Customers](../../doc/api/customers.md#search-customers) +* [Delete Customer](../../doc/api/customers.md#delete-customer) +* [Retrieve Customer](../../doc/api/customers.md#retrieve-customer) +* [Update Customer](../../doc/api/customers.md#update-customer) +* [Create Customer Card](../../doc/api/customers.md#create-customer-card) +* [Delete Customer Card](../../doc/api/customers.md#delete-customer-card) +* [Remove Group From Customer](../../doc/api/customers.md#remove-group-from-customer) +* [Add Group to Customer](../../doc/api/customers.md#add-group-to-customer) + + +# List Customers + +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. + +```ts +async listCustomers( + cursor?: string, + limit?: number, + sortField?: string, + sortOrder?: string, + count?: boolean, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `cursor` | `string \| undefined` | Query, Optional | 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` | `number \| undefined` | Query, Optional | 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). | +| `sortField` | [`string \| undefined`](../../doc/models/customer-sort-field.md) | Query, Optional | Indicates how customers should be sorted.

The default value is `DEFAULT`. | +| `sortOrder` | [`string \| undefined`](../../doc/models/sort-order.md) | Query, Optional | Indicates whether customers should be sorted in ascending (`ASC`) or
descending (`DESC`) order.

The default value is `ASC`. | +| `count` | `boolean \| undefined` | Query, Optional | Indicates whether to return the total count of customers in the `count` field of the response.

The default value is `false`.
**Default**: `false` | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListCustomersResponse`](../../doc/models/list-customers-response.md) + +## Example Usage + +```ts +const count = false; + +try { + const { result, ...httpResponse } = await customersApi.listCustomers( + undefined, + undefined, + undefined, + undefined, + count +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Create Customer + +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` + +```ts +async createCustomer( + body: CreateCustomerRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`CreateCustomerRequest`](../../doc/models/create-customer-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CreateCustomerResponse`](../../doc/models/create-customer-response.md) + +## Example Usage + +```ts +const body: CreateCustomerRequest = { + givenName: 'Amelia', + familyName: 'Earhart', + 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', + referenceId: 'YOUR_REFERENCE_ID', + note: 'a customer', +}; + +try { + const { result, ...httpResponse } = await customersApi.createCustomer(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Bulk Create Customers + +Creates multiple [customer profiles](../../doc/models/customer.md) 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` + +```ts +async bulkCreateCustomers( + body: BulkCreateCustomersRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BulkCreateCustomersRequest`](../../doc/models/bulk-create-customers-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`BulkCreateCustomersResponse`](../../doc/models/bulk-create-customers-response.md) + +## Example Usage + +```ts +const body: BulkCreateCustomersRequest = { + customers: { + '8bb76c4f-e35d-4c5b-90de-1194cd9179f0': { + givenName: 'Amelia', + familyName: 'Earhart', + 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', + referenceId: 'YOUR_REFERENCE_ID', + note: 'a customer', + }, + 'd1689f23-b25d-4932-b2f0-aed00f5e2029': { + givenName: 'Marie', + familyName: 'Curie', + emailAddress: 'Marie.Curie@example.com', + address: { + addressLine1: '500 Electric Ave', + addressLine2: 'Suite 601', + locality: 'New York', + administrativeDistrictLevel1: 'NY', + postalCode: '10003', + country: 'US', + }, + phoneNumber: '+1-212-444-4240', + referenceId: 'YOUR_REFERENCE_ID', + note: 'another customer', + } + }, +}; + +try { + const { result, ...httpResponse } = await customersApi.bulkCreateCustomers(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Bulk Delete Customers + +Deletes multiple customer profiles. + +The endpoint takes a list of customer IDs and returns a map of responses. + +```ts +async bulkDeleteCustomers( + body: BulkDeleteCustomersRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BulkDeleteCustomersRequest`](../../doc/models/bulk-delete-customers-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`BulkDeleteCustomersResponse`](../../doc/models/bulk-delete-customers-response.md) + +## Example Usage + +```ts +const body: BulkDeleteCustomersRequest = { + customerIds: [ + '8DDA5NZVBZFGAX0V3HPF81HHE0', + 'N18CPRVXR5214XPBBA6BZQWF3C', + '2GYD7WNXF7BJZW1PMGNXZ3Y8M8' + ], +}; + +try { + const { result, ...httpResponse } = await customersApi.bulkDeleteCustomers(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Bulk Retrieve Customers + +Retrieves multiple customer profiles. + +This endpoint takes a list of customer IDs and returns a map of responses. + +```ts +async bulkRetrieveCustomers( + body: BulkRetrieveCustomersRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BulkRetrieveCustomersRequest`](../../doc/models/bulk-retrieve-customers-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`BulkRetrieveCustomersResponse`](../../doc/models/bulk-retrieve-customers-response.md) + +## Example Usage + +```ts +const body: BulkRetrieveCustomersRequest = { + customerIds: [ + '8DDA5NZVBZFGAX0V3HPF81HHE0', + 'N18CPRVXR5214XPBBA6BZQWF3C', + '2GYD7WNXF7BJZW1PMGNXZ3Y8M8' + ], +}; + +try { + const { result, ...httpResponse } = await customersApi.bulkRetrieveCustomers(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Bulk Update Customers + +Updates multiple customer profiles. + +This endpoint takes a map of individual update requests and returns a map of responses. + +You cannot use this endpoint to change cards on file. To make changes, use the [Cards API](../../doc/api/cards.md) or [Gift Cards API](../../doc/api/gift-cards.md). + +```ts +async bulkUpdateCustomers( + body: BulkUpdateCustomersRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BulkUpdateCustomersRequest`](../../doc/models/bulk-update-customers-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`BulkUpdateCustomersResponse`](../../doc/models/bulk-update-customers-response.md) + +## Example Usage + +```ts +const body: BulkUpdateCustomersRequest = { + customers: { + '8DDA5NZVBZFGAX0V3HPF81HHE0': { + emailAddress: 'New.Amelia.Earhart@example.com', + phoneNumber: 'phone_number2', + note: 'updated customer note', + version: BigInt(2), + }, + 'N18CPRVXR5214XPBBA6BZQWF3C': { + givenName: 'Marie', + familyName: 'Curie', + version: BigInt(0), + } + }, +}; + +try { + const { result, ...httpResponse } = await customersApi.bulkUpdateCustomers(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Search Customers + +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. + +```ts +async searchCustomers( + body: SearchCustomersRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`SearchCustomersRequest`](../../doc/models/search-customers-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`SearchCustomersResponse`](../../doc/models/search-customers-response.md) + +## Example Usage + +```ts +const body: SearchCustomersRequest = { + limit: BigInt(2), + query: { + filter: { + creationSource: { + values: [ + 'THIRD_PARTY' + ], + rule: 'INCLUDE', + }, + createdAt: { + startAt: '2018-01-01T00:00:00-00:00', + endAt: '2018-02-01T00:00:00-00:00', + }, + emailAddress: { + fuzzy: 'example.com', + }, + groupIds: { + all: [ + '545AXB44B4XXWMVQ4W8SBT3HHF' + ], + }, + }, + sort: { + field: 'CREATED_AT', + order: 'ASC', + }, + }, +}; + +try { + const { result, ...httpResponse } = await customersApi.searchCustomers(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Delete Customer + +Deletes a customer profile from a business. This operation also unlinks any associated cards on file. + +To delete a customer profile that was created by merging existing profiles, you must use the ID of the newly created profile. + +```ts +async deleteCustomer( + customerId: string, + version?: bigint, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `customerId` | `string` | Template, Required | The ID of the customer to delete. | +| `version` | `bigint \| undefined` | Query, Optional | 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). | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`DeleteCustomerResponse`](../../doc/models/delete-customer-response.md) + +## Example Usage + +```ts +const customerId = 'customer_id8'; + +try { + const { result, ...httpResponse } = await customersApi.deleteCustomer(customerId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Customer + +Returns details for a single customer. + +```ts +async retrieveCustomer( + customerId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `customerId` | `string` | Template, Required | The ID of the customer to retrieve. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveCustomerResponse`](../../doc/models/retrieve-customer-response.md) + +## Example Usage + +```ts +const customerId = 'customer_id8'; + +try { + const { result, ...httpResponse } = await customersApi.retrieveCustomer(customerId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Update Customer + +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. + +You cannot use this endpoint to change cards on file. To make changes, use the [Cards API](../../doc/api/cards.md) or [Gift Cards API](../../doc/api/gift-cards.md). + +```ts +async updateCustomer( + customerId: string, + body: UpdateCustomerRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `customerId` | `string` | Template, Required | The ID of the customer to update. | +| `body` | [`UpdateCustomerRequest`](../../doc/models/update-customer-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`UpdateCustomerResponse`](../../doc/models/update-customer-response.md) + +## Example Usage + +```ts +const customerId = 'customer_id8'; + +const body: UpdateCustomerRequest = { + emailAddress: 'New.Amelia.Earhart@example.com', + phoneNumber: 'phone_number2', + note: 'updated customer note', + version: BigInt(2), +}; + +try { + const { result, ...httpResponse } = await customersApi.updateCustomer( + customerId, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Create Customer Card + +**This endpoint is deprecated.** + +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. + +```ts +async createCustomerCard( + customerId: string, + body: CreateCustomerCardRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `customerId` | `string` | Template, Required | The Square ID of the customer profile the card is linked to. | +| `body` | [`CreateCustomerCardRequest`](../../doc/models/create-customer-card-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CreateCustomerCardResponse`](../../doc/models/create-customer-card-response.md) + +## Example Usage + +```ts +const customerId = 'customer_id8'; + +const body: CreateCustomerCardRequest = { + cardNonce: 'YOUR_CARD_NONCE', + billingAddress: { + addressLine1: '500 Electric Ave', + addressLine2: 'Suite 600', + locality: 'New York', + administrativeDistrictLevel1: 'NY', + postalCode: '10003', + country: 'US', + }, + cardholderName: 'Amelia Earhart', +}; + +try { + const { result, ...httpResponse } = await customersApi.createCustomerCard( + customerId, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Delete Customer Card + +**This endpoint is deprecated.** + +Removes a card on file from a customer. + +```ts +async deleteCustomerCard( + customerId: string, + cardId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `customerId` | `string` | Template, Required | The ID of the customer that the card on file belongs to. | +| `cardId` | `string` | Template, Required | The ID of the card on file to delete. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`DeleteCustomerCardResponse`](../../doc/models/delete-customer-card-response.md) + +## Example Usage + +```ts +const customerId = 'customer_id8'; + +const cardId = 'card_id4'; + +try { + const { result, ...httpResponse } = await customersApi.deleteCustomerCard( + customerId, + cardId +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Remove Group From Customer + +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. + +```ts +async removeGroupFromCustomer( + customerId: string, + groupId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `customerId` | `string` | Template, Required | The ID of the customer to remove from the group. | +| `groupId` | `string` | Template, Required | The ID of the customer group to remove the customer from. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RemoveGroupFromCustomerResponse`](../../doc/models/remove-group-from-customer-response.md) + +## Example Usage + +```ts +const customerId = 'customer_id8'; + +const groupId = 'group_id0'; + +try { + const { result, ...httpResponse } = await customersApi.removeGroupFromCustomer( + customerId, + groupId +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Add Group to Customer + +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. + +```ts +async addGroupToCustomer( + customerId: string, + groupId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `customerId` | `string` | Template, Required | The ID of the customer to add to a group. | +| `groupId` | `string` | Template, Required | The ID of the customer group to add the customer to. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`AddGroupToCustomerResponse`](../../doc/models/add-group-to-customer-response.md) + +## Example Usage + +```ts +const customerId = 'customer_id8'; + +const groupId = 'group_id0'; + +try { + const { result, ...httpResponse } = await customersApi.addGroupToCustomer( + customerId, + groupId +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/devices.md b/legacy/doc/api/devices.md new file mode 100644 index 000000000..f370647fe --- /dev/null +++ b/legacy/doc/api/devices.md @@ -0,0 +1,235 @@ +# Devices + +```ts +const devicesApi = client.devicesApi; +``` + +## Class Name + +`DevicesApi` + +## Methods + +* [List Devices](../../doc/api/devices.md#list-devices) +* [List Device Codes](../../doc/api/devices.md#list-device-codes) +* [Create Device Code](../../doc/api/devices.md#create-device-code) +* [Get Device Code](../../doc/api/devices.md#get-device-code) +* [Get Device](../../doc/api/devices.md#get-device) + + +# List Devices + +List devices associated with the merchant. Currently, only Terminal API +devices are supported. + +```ts +async listDevices( + cursor?: string, + sortOrder?: string, + limit?: number, + locationId?: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `cursor` | `string \| undefined` | Query, Optional | 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. | +| `sortOrder` | [`string \| undefined`](../../doc/models/sort-order.md) | Query, Optional | The order in which results are listed.

- `ASC` - Oldest to newest.
- `DESC` - Newest to oldest (default). | +| `limit` | `number \| undefined` | Query, Optional | The number of results to return in a single page. | +| `locationId` | `string \| undefined` | Query, Optional | If present, only returns devices at the target location. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListDevicesResponse`](../../doc/models/list-devices-response.md) + +## Example Usage + +```ts +try { + const { result, ...httpResponse } = await devicesApi.listDevices(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# List Device Codes + +Lists all DeviceCodes associated with the merchant. + +```ts +async listDeviceCodes( + cursor?: string, + locationId?: string, + productType?: string, + status?: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `cursor` | `string \| undefined` | Query, Optional | 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. | +| `locationId` | `string \| undefined` | Query, Optional | If specified, only returns DeviceCodes of the specified location.
Returns DeviceCodes of all locations if empty. | +| `productType` | [`string \| undefined`](../../doc/models/product-type.md) | Query, Optional | If specified, only returns DeviceCodes targeting the specified product type.
Returns DeviceCodes of all product types if empty. | +| `status` | [`string \| undefined`](../../doc/models/device-code-status.md) | Query, Optional | If specified, returns DeviceCodes with the specified statuses.
Returns DeviceCodes of status `PAIRED` and `UNPAIRED` if empty. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListDeviceCodesResponse`](../../doc/models/list-device-codes-response.md) + +## Example Usage + +```ts +try { + const { result, ...httpResponse } = await devicesApi.listDeviceCodes(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Create Device Code + +Creates a DeviceCode that can be used to login to a Square Terminal device to enter the connected +terminal mode. + +```ts +async createDeviceCode( + body: CreateDeviceCodeRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`CreateDeviceCodeRequest`](../../doc/models/create-device-code-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CreateDeviceCodeResponse`](../../doc/models/create-device-code-response.md) + +## Example Usage + +```ts +const body: CreateDeviceCodeRequest = { + idempotencyKey: '01bb00a6-0c86-4770-94ed-f5fca973cd56', + deviceCode: { + productType: 'TERMINAL_API', + name: 'Counter 1', + locationId: 'B5E4484SHHNYH', + }, +}; + +try { + const { result, ...httpResponse } = await devicesApi.createDeviceCode(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Get Device Code + +Retrieves DeviceCode with the associated ID. + +```ts +async getDeviceCode( + id: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string` | Template, Required | The unique identifier for the device code. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`GetDeviceCodeResponse`](../../doc/models/get-device-code-response.md) + +## Example Usage + +```ts +const id = 'id0'; + +try { + const { result, ...httpResponse } = await devicesApi.getDeviceCode(id); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Get Device + +Retrieves Device with the associated `device_id`. + +```ts +async getDevice( + deviceId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `deviceId` | `string` | Template, Required | The unique ID for the desired `Device`. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`GetDeviceResponse`](../../doc/models/get-device-response.md) + +## Example Usage + +```ts +const deviceId = 'device_id6'; + +try { + const { result, ...httpResponse } = await devicesApi.getDevice(deviceId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/disputes.md b/legacy/doc/api/disputes.md new file mode 100644 index 000000000..1356cba01 --- /dev/null +++ b/legacy/doc/api/disputes.md @@ -0,0 +1,429 @@ +# Disputes + +```ts +const disputesApi = client.disputesApi; +``` + +## Class Name + +`DisputesApi` + +## Methods + +* [List Disputes](../../doc/api/disputes.md#list-disputes) +* [Retrieve Dispute](../../doc/api/disputes.md#retrieve-dispute) +* [Accept Dispute](../../doc/api/disputes.md#accept-dispute) +* [List Dispute Evidence](../../doc/api/disputes.md#list-dispute-evidence) +* [Create Dispute Evidence File](../../doc/api/disputes.md#create-dispute-evidence-file) +* [Create Dispute Evidence Text](../../doc/api/disputes.md#create-dispute-evidence-text) +* [Delete Dispute Evidence](../../doc/api/disputes.md#delete-dispute-evidence) +* [Retrieve Dispute Evidence](../../doc/api/disputes.md#retrieve-dispute-evidence) +* [Submit Evidence](../../doc/api/disputes.md#submit-evidence) + + +# List Disputes + +Returns a list of disputes associated with a particular account. + +```ts +async listDisputes( + cursor?: string, + states?: string, + locationId?: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `cursor` | `string \| undefined` | Query, Optional | 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` | [`string \| undefined`](../../doc/models/dispute-state.md) | Query, Optional | The dispute states used to filter the result. If not specified, the endpoint returns all disputes. | +| `locationId` | `string \| undefined` | Query, Optional | The ID of the location for which to return a list of disputes.
If not specified, the endpoint returns disputes associated with all locations. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListDisputesResponse`](../../doc/models/list-disputes-response.md) + +## Example Usage + +```ts +try { + const { result, ...httpResponse } = await disputesApi.listDisputes(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Dispute + +Returns details about a specific dispute. + +```ts +async retrieveDispute( + disputeId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `disputeId` | `string` | Template, Required | The ID of the dispute you want more details about. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveDisputeResponse`](../../doc/models/retrieve-dispute-response.md) + +## Example Usage + +```ts +const disputeId = 'dispute_id2'; + +try { + const { result, ...httpResponse } = await disputesApi.retrieveDispute(disputeId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Accept Dispute + +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. + +```ts +async acceptDispute( + disputeId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `disputeId` | `string` | Template, Required | The ID of the dispute you want to accept. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`AcceptDisputeResponse`](../../doc/models/accept-dispute-response.md) + +## Example Usage + +```ts +const disputeId = 'dispute_id2'; + +try { + const { result, ...httpResponse } = await disputesApi.acceptDispute(disputeId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# List Dispute Evidence + +Returns a list of evidence associated with a dispute. + +```ts +async listDisputeEvidence( + disputeId: string, + cursor?: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `disputeId` | `string` | Template, Required | The ID of the dispute. | +| `cursor` | `string \| undefined` | Query, Optional | 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). | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListDisputeEvidenceResponse`](../../doc/models/list-dispute-evidence-response.md) + +## Example Usage + +```ts +const disputeId = 'dispute_id2'; + +try { + const { result, ...httpResponse } = await disputesApi.listDisputeEvidence(disputeId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Create Dispute Evidence File + +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. + +```ts +async createDisputeEvidenceFile( + disputeId: string, + request?: CreateDisputeEvidenceFileRequest, + imageFile?: FileWrapper, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `disputeId` | `string` | Template, Required | The ID of the dispute for which you want to upload evidence. | +| `request` | [`CreateDisputeEvidenceFileRequest \| undefined`](../../doc/models/create-dispute-evidence-file-request.md) | Form (JSON-Encoded), Optional | Defines the parameters for a `CreateDisputeEvidenceFile` request. | +| `imageFile` | `FileWrapper \| undefined` | Form, Optional | - | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CreateDisputeEvidenceFileResponse`](../../doc/models/create-dispute-evidence-file-response.md) + +## Example Usage + +```ts +const disputeId = 'dispute_id2'; + +try { + const { result, ...httpResponse } = await disputesApi.createDisputeEvidenceFile(disputeId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Create Dispute Evidence Text + +Uploads text to use as evidence for a dispute challenge. + +```ts +async createDisputeEvidenceText( + disputeId: string, + body: CreateDisputeEvidenceTextRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `disputeId` | `string` | Template, Required | The ID of the dispute for which you want to upload evidence. | +| `body` | [`CreateDisputeEvidenceTextRequest`](../../doc/models/create-dispute-evidence-text-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CreateDisputeEvidenceTextResponse`](../../doc/models/create-dispute-evidence-text-response.md) + +## Example Usage + +```ts +const disputeId = 'dispute_id2'; + +const body: CreateDisputeEvidenceTextRequest = { + idempotencyKey: 'ed3ee3933d946f1514d505d173c82648', + evidenceText: '1Z8888888888888888', + evidenceType: 'TRACKING_NUMBER', +}; + +try { + const { result, ...httpResponse } = await disputesApi.createDisputeEvidenceText( + disputeId, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Delete Dispute Evidence + +Removes specified evidence from a dispute. +Square does not send the bank any evidence that is removed. + +```ts +async deleteDisputeEvidence( + disputeId: string, + evidenceId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `disputeId` | `string` | Template, Required | The ID of the dispute from which you want to remove evidence. | +| `evidenceId` | `string` | Template, Required | The ID of the evidence you want to remove. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`DeleteDisputeEvidenceResponse`](../../doc/models/delete-dispute-evidence-response.md) + +## Example Usage + +```ts +const disputeId = 'dispute_id2'; + +const evidenceId = 'evidence_id2'; + +try { + const { result, ...httpResponse } = await disputesApi.deleteDisputeEvidence( + disputeId, + evidenceId +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Dispute Evidence + +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. + +```ts +async retrieveDisputeEvidence( + disputeId: string, + evidenceId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `disputeId` | `string` | Template, Required | The ID of the dispute from which you want to retrieve evidence metadata. | +| `evidenceId` | `string` | Template, Required | The ID of the evidence to retrieve. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveDisputeEvidenceResponse`](../../doc/models/retrieve-dispute-evidence-response.md) + +## Example Usage + +```ts +const disputeId = 'dispute_id2'; + +const evidenceId = 'evidence_id2'; + +try { + const { result, ...httpResponse } = await disputesApi.retrieveDisputeEvidence( + disputeId, + evidenceId +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Submit Evidence + +Submits evidence to the cardholder's bank. + +The evidence submitted by this endpoint includes evidence uploaded +using the [CreateDisputeEvidenceFile](../../doc/api/disputes.md#create-dispute-evidence-file) and +[CreateDisputeEvidenceText](../../doc/api/disputes.md#create-dispute-evidence-text) endpoints and +evidence automatically provided by Square, when available. Evidence cannot be removed from +a dispute after submission. + +```ts +async submitEvidence( + disputeId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `disputeId` | `string` | Template, Required | The ID of the dispute for which you want to submit evidence. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`SubmitEvidenceResponse`](../../doc/models/submit-evidence-response.md) + +## Example Usage + +```ts +const disputeId = 'dispute_id2'; + +try { + const { result, ...httpResponse } = await disputesApi.submitEvidence(disputeId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/employees.md b/legacy/doc/api/employees.md new file mode 100644 index 000000000..8b3bb97f7 --- /dev/null +++ b/legacy/doc/api/employees.md @@ -0,0 +1,99 @@ +# Employees + +```ts +const employeesApi = client.employeesApi; +``` + +## Class Name + +`EmployeesApi` + +## Methods + +* [List Employees](../../doc/api/employees.md#list-employees) +* [Retrieve Employee](../../doc/api/employees.md#retrieve-employee) + + +# List Employees + +**This endpoint is deprecated.** + +```ts +async listEmployees( + locationId?: string, + status?: string, + limit?: number, + cursor?: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string \| undefined` | Query, Optional | - | +| `status` | [`string \| undefined`](../../doc/models/employee-status.md) | Query, Optional | Specifies the EmployeeStatus to filter the employee by. | +| `limit` | `number \| undefined` | Query, Optional | The number of employees to be returned on each page. | +| `cursor` | `string \| undefined` | Query, Optional | The token required to retrieve the specified page of results. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListEmployeesResponse`](../../doc/models/list-employees-response.md) + +## Example Usage + +```ts +try { + const { result, ...httpResponse } = await employeesApi.listEmployees(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Employee + +**This endpoint is deprecated.** + +```ts +async retrieveEmployee( + id: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string` | Template, Required | UUID for the employee that was requested. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveEmployeeResponse`](../../doc/models/retrieve-employee-response.md) + +## Example Usage + +```ts +const id = 'id0'; + +try { + const { result, ...httpResponse } = await employeesApi.retrieveEmployee(id); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/events.md b/legacy/doc/api/events.md new file mode 100644 index 000000000..aba749909 --- /dev/null +++ b/legacy/doc/api/events.md @@ -0,0 +1,170 @@ +# Events + +```ts +const eventsApi = client.eventsApi; +``` + +## Class Name + +`EventsApi` + +## Methods + +* [Search Events](../../doc/api/events.md#search-events) +* [Disable Events](../../doc/api/events.md#disable-events) +* [Enable Events](../../doc/api/events.md#enable-events) +* [List Event Types](../../doc/api/events.md#list-event-types) + + +# Search Events + +Search for Square API events that occur within a 28-day timeframe. + +```ts +async searchEvents( + body: SearchEventsRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`SearchEventsRequest`](../../doc/models/search-events-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`SearchEventsResponse`](../../doc/models/search-events-response.md) + +## Example Usage + +```ts +const body: SearchEventsRequest = { +}; + +try { + const { result, ...httpResponse } = await eventsApi.searchEvents(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Disable Events + +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. + +```ts +async disableEvents( + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`DisableEventsResponse`](../../doc/models/disable-events-response.md) + +## Example Usage + +```ts +try { + const { result, ...httpResponse } = await eventsApi.disableEvents(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Enable Events + +Enables events to make them searchable. Only events that occur while in the enabled state are searchable. + +```ts +async enableEvents( + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`EnableEventsResponse`](../../doc/models/enable-events-response.md) + +## Example Usage + +```ts +try { + const { result, ...httpResponse } = await eventsApi.enableEvents(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# List Event Types + +Lists all event types that you can subscribe to as webhooks or query using the Events API. + +```ts +async listEventTypes( + apiVersion?: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `apiVersion` | `string \| undefined` | Query, Optional | The API version for which to list event types. Setting this field overrides the default version used by the application. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListEventTypesResponse`](../../doc/models/list-event-types-response.md) + +## Example Usage + +```ts +try { + const { result, ...httpResponse } = await eventsApi.listEventTypes(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/gift-card-activities.md b/legacy/doc/api/gift-card-activities.md new file mode 100644 index 000000000..04c24c484 --- /dev/null +++ b/legacy/doc/api/gift-card-activities.md @@ -0,0 +1,122 @@ +# Gift Card Activities + +```ts +const giftCardActivitiesApi = client.giftCardActivitiesApi; +``` + +## Class Name + +`GiftCardActivitiesApi` + +## Methods + +* [List Gift Card Activities](../../doc/api/gift-card-activities.md#list-gift-card-activities) +* [Create Gift Card Activity](../../doc/api/gift-card-activities.md#create-gift-card-activity) + + +# List Gift Card Activities + +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. + +```ts +async listGiftCardActivities( + giftCardId?: string, + type?: string, + locationId?: string, + beginTime?: string, + endTime?: string, + limit?: number, + cursor?: string, + sortOrder?: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `giftCardId` | `string \| undefined` | Query, Optional | 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` | `string \| undefined` | Query, Optional | 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. | +| `locationId` | `string \| undefined` | Query, Optional | 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. | +| `beginTime` | `string \| undefined` | Query, Optional | 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. | +| `endTime` | `string \| undefined` | Query, Optional | 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` | `number \| undefined` | Query, Optional | 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` | `string \| undefined` | Query, Optional | 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). | +| `sortOrder` | `string \| undefined` | Query, Optional | The order in which the endpoint returns the activities, based on `created_at`.

- `ASC` - Oldest to newest.
- `DESC` - Newest to oldest (default). | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListGiftCardActivitiesResponse`](../../doc/models/list-gift-card-activities-response.md) + +## Example Usage + +```ts +try { + const { result, ...httpResponse } = await giftCardActivitiesApi.listGiftCardActivities(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Create Gift Card Activity + +Creates a gift card activity to manage the balance or state of a [gift card](../../doc/models/gift-card.md). +For example, create an `ACTIVATE` activity to activate a gift card with an initial balance before first use. + +```ts +async createGiftCardActivity( + body: CreateGiftCardActivityRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`CreateGiftCardActivityRequest`](../../doc/models/create-gift-card-activity-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CreateGiftCardActivityResponse`](../../doc/models/create-gift-card-activity-response.md) + +## Example Usage + +```ts +const body: CreateGiftCardActivityRequest = { + idempotencyKey: 'U16kfr-kA70er-q4Rsym-7U7NnY', + giftCardActivity: { + type: 'ACTIVATE', + locationId: '81FN9BNFZTKS4', + giftCardId: 'gftc:6d55a72470d940c6ba09c0ab8ad08d20', + activateActivityDetails: { + orderId: 'jJNGHm4gLI6XkFbwtiSLqK72KkAZY', + lineItemUid: 'eIWl7X0nMuO9Ewbh0ChIx', + }, + }, +}; + +try { + const { result, ...httpResponse } = await giftCardActivitiesApi.createGiftCardActivity(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/gift-cards.md b/legacy/doc/api/gift-cards.md new file mode 100644 index 000000000..fcdf4b737 --- /dev/null +++ b/legacy/doc/api/gift-cards.md @@ -0,0 +1,339 @@ +# Gift Cards + +```ts +const giftCardsApi = client.giftCardsApi; +``` + +## Class Name + +`GiftCardsApi` + +## Methods + +* [List Gift Cards](../../doc/api/gift-cards.md#list-gift-cards) +* [Create Gift Card](../../doc/api/gift-cards.md#create-gift-card) +* [Retrieve Gift Card From GAN](../../doc/api/gift-cards.md#retrieve-gift-card-from-gan) +* [Retrieve Gift Card From Nonce](../../doc/api/gift-cards.md#retrieve-gift-card-from-nonce) +* [Link Customer to Gift Card](../../doc/api/gift-cards.md#link-customer-to-gift-card) +* [Unlink Customer From Gift Card](../../doc/api/gift-cards.md#unlink-customer-from-gift-card) +* [Retrieve Gift Card](../../doc/api/gift-cards.md#retrieve-gift-card) + + +# List Gift Cards + +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. + +```ts +async listGiftCards( + type?: string, + state?: string, + limit?: number, + cursor?: string, + customerId?: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `type` | `string \| undefined` | Query, Optional | 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` | `string \| undefined` | Query, Optional | 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` | `number \| undefined` | Query, Optional | 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` | `string \| undefined` | Query, Optional | 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). | +| `customerId` | `string \| undefined` | Query, Optional | If a customer ID is provided, the endpoint returns only the gift cards linked to the specified customer. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListGiftCardsResponse`](../../doc/models/list-gift-cards-response.md) + +## Example Usage + +```ts +try { + const { result, ...httpResponse } = await giftCardsApi.listGiftCards(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Create Gift Card + +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](../../doc/api/gift-card-activities.md#create-gift-card-activity) and create an `ACTIVATE` +activity with the initial balance. Alternatively, you can use [RefundPayment](../../doc/api/refunds.md#refund-payment) +to refund a payment to the new gift card. + +```ts +async createGiftCard( + body: CreateGiftCardRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`CreateGiftCardRequest`](../../doc/models/create-gift-card-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CreateGiftCardResponse`](../../doc/models/create-gift-card-response.md) + +## Example Usage + +```ts +const body: CreateGiftCardRequest = { + idempotencyKey: 'NC9Tm69EjbjtConu', + locationId: '81FN9BNFZTKS4', + giftCard: { + type: 'DIGITAL', + }, +}; + +try { + const { result, ...httpResponse } = await giftCardsApi.createGiftCard(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Gift Card From GAN + +Retrieves a gift card using the gift card account number (GAN). + +```ts +async retrieveGiftCardFromGAN( + body: RetrieveGiftCardFromGANRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`RetrieveGiftCardFromGANRequest`](../../doc/models/retrieve-gift-card-from-gan-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveGiftCardFromGANResponse`](../../doc/models/retrieve-gift-card-from-gan-response.md) + +## Example Usage + +```ts +const body: RetrieveGiftCardFromGANRequest = { + gan: '7783320001001635', +}; + +try { + const { result, ...httpResponse } = await giftCardsApi.retrieveGiftCardFromGAN(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Gift Card From Nonce + +Retrieves a gift card using a secure payment token that represents the gift card. + +```ts +async retrieveGiftCardFromNonce( + body: RetrieveGiftCardFromNonceRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`RetrieveGiftCardFromNonceRequest`](../../doc/models/retrieve-gift-card-from-nonce-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveGiftCardFromNonceResponse`](../../doc/models/retrieve-gift-card-from-nonce-response.md) + +## Example Usage + +```ts +const body: RetrieveGiftCardFromNonceRequest = { + nonce: 'cnon:7783322135245171', +}; + +try { + const { result, ...httpResponse } = await giftCardsApi.retrieveGiftCardFromNonce(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Link Customer to Gift Card + +Links a customer to a gift card, which is also referred to as adding a card on file. + +```ts +async linkCustomerToGiftCard( + giftCardId: string, + body: LinkCustomerToGiftCardRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `giftCardId` | `string` | Template, Required | The ID of the gift card to be linked. | +| `body` | [`LinkCustomerToGiftCardRequest`](../../doc/models/link-customer-to-gift-card-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`LinkCustomerToGiftCardResponse`](../../doc/models/link-customer-to-gift-card-response.md) + +## Example Usage + +```ts +const giftCardId = 'gift_card_id8'; + +const body: LinkCustomerToGiftCardRequest = { + customerId: 'GKY0FZ3V717AH8Q2D821PNT2ZW', +}; + +try { + const { result, ...httpResponse } = await giftCardsApi.linkCustomerToGiftCard( + giftCardId, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Unlink Customer From Gift Card + +Unlinks a customer from a gift card, which is also referred to as removing a card on file. + +```ts +async unlinkCustomerFromGiftCard( + giftCardId: string, + body: UnlinkCustomerFromGiftCardRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `giftCardId` | `string` | Template, Required | The ID of the gift card to be unlinked. | +| `body` | [`UnlinkCustomerFromGiftCardRequest`](../../doc/models/unlink-customer-from-gift-card-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`UnlinkCustomerFromGiftCardResponse`](../../doc/models/unlink-customer-from-gift-card-response.md) + +## Example Usage + +```ts +const giftCardId = 'gift_card_id8'; + +const body: UnlinkCustomerFromGiftCardRequest = { + customerId: 'GKY0FZ3V717AH8Q2D821PNT2ZW', +}; + +try { + const { result, ...httpResponse } = await giftCardsApi.unlinkCustomerFromGiftCard( + giftCardId, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Gift Card + +Retrieves a gift card using the gift card ID. + +```ts +async retrieveGiftCard( + id: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string` | Template, Required | The ID of the gift card to retrieve. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveGiftCardResponse`](../../doc/models/retrieve-gift-card-response.md) + +## Example Usage + +```ts +const id = 'id0'; + +try { + const { result, ...httpResponse } = await giftCardsApi.retrieveGiftCard(id); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/inventory.md b/legacy/doc/api/inventory.md new file mode 100644 index 000000000..765f5f824 --- /dev/null +++ b/legacy/doc/api/inventory.md @@ -0,0 +1,690 @@ +# Inventory + +```ts +const inventoryApi = client.inventoryApi; +``` + +## Class Name + +`InventoryApi` + +## Methods + +* [Deprecated Retrieve Inventory Adjustment](../../doc/api/inventory.md#deprecated-retrieve-inventory-adjustment) +* [Retrieve Inventory Adjustment](../../doc/api/inventory.md#retrieve-inventory-adjustment) +* [Deprecated Batch Change Inventory](../../doc/api/inventory.md#deprecated-batch-change-inventory) +* [Deprecated Batch Retrieve Inventory Changes](../../doc/api/inventory.md#deprecated-batch-retrieve-inventory-changes) +* [Deprecated Batch Retrieve Inventory Counts](../../doc/api/inventory.md#deprecated-batch-retrieve-inventory-counts) +* [Batch Change Inventory](../../doc/api/inventory.md#batch-change-inventory) +* [Batch Retrieve Inventory Changes](../../doc/api/inventory.md#batch-retrieve-inventory-changes) +* [Batch Retrieve Inventory Counts](../../doc/api/inventory.md#batch-retrieve-inventory-counts) +* [Deprecated Retrieve Inventory Physical Count](../../doc/api/inventory.md#deprecated-retrieve-inventory-physical-count) +* [Retrieve Inventory Physical Count](../../doc/api/inventory.md#retrieve-inventory-physical-count) +* [Retrieve Inventory Transfer](../../doc/api/inventory.md#retrieve-inventory-transfer) +* [Retrieve Inventory Count](../../doc/api/inventory.md#retrieve-inventory-count) +* [Retrieve Inventory Changes](../../doc/api/inventory.md#retrieve-inventory-changes) + + +# Deprecated Retrieve Inventory Adjustment + +**This endpoint is deprecated.** + +Deprecated version of [RetrieveInventoryAdjustment](api-endpoint:Inventory-RetrieveInventoryAdjustment) after the endpoint URL +is updated to conform to the standard convention. + +```ts +async deprecatedRetrieveInventoryAdjustment( + adjustmentId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `adjustmentId` | `string` | Template, Required | ID of the [InventoryAdjustment](entity:InventoryAdjustment) to retrieve. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveInventoryAdjustmentResponse`](../../doc/models/retrieve-inventory-adjustment-response.md) + +## Example Usage + +```ts +const adjustmentId = 'adjustment_id0'; + +try { + const { result, ...httpResponse } = await inventoryApi.deprecatedRetrieveInventoryAdjustment(adjustmentId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Inventory Adjustment + +Returns the [InventoryAdjustment](../../doc/models/inventory-adjustment.md) object +with the provided `adjustment_id`. + +```ts +async retrieveInventoryAdjustment( + adjustmentId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `adjustmentId` | `string` | Template, Required | ID of the [InventoryAdjustment](entity:InventoryAdjustment) to retrieve. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveInventoryAdjustmentResponse`](../../doc/models/retrieve-inventory-adjustment-response.md) + +## Example Usage + +```ts +const adjustmentId = 'adjustment_id0'; + +try { + const { result, ...httpResponse } = await inventoryApi.retrieveInventoryAdjustment(adjustmentId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Deprecated Batch Change Inventory + +**This endpoint is deprecated.** + +Deprecated version of [BatchChangeInventory](api-endpoint:Inventory-BatchChangeInventory) after the endpoint URL +is updated to conform to the standard convention. + +```ts +async deprecatedBatchChangeInventory( + body: BatchChangeInventoryRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BatchChangeInventoryRequest`](../../doc/models/batch-change-inventory-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`BatchChangeInventoryResponse`](../../doc/models/batch-change-inventory-response.md) + +## Example Usage + +```ts +const body: BatchChangeInventoryRequest = { + idempotencyKey: '8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe', + changes: [ + { + type: 'PHYSICAL_COUNT', + physicalCount: { + referenceId: '1536bfbf-efed-48bf-b17d-a197141b2a92', + catalogObjectId: 'W62UWFY35CWMYGVWK6TWJDNI', + state: 'IN_STOCK', + locationId: 'C6W5YS5QM06F5', + quantity: '53', + teamMemberId: 'LRK57NSQ5X7PUD05', + occurredAt: '2016-11-16T22:25:24.878Z', + }, + } + ], + ignoreUnchangedCounts: true, +}; + +try { + const { result, ...httpResponse } = await inventoryApi.deprecatedBatchChangeInventory(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Deprecated Batch Retrieve Inventory Changes + +**This endpoint is deprecated.** + +Deprecated version of [BatchRetrieveInventoryChanges](api-endpoint:Inventory-BatchRetrieveInventoryChanges) after the endpoint URL +is updated to conform to the standard convention. + +```ts +async deprecatedBatchRetrieveInventoryChanges( + body: BatchRetrieveInventoryChangesRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BatchRetrieveInventoryChangesRequest`](../../doc/models/batch-retrieve-inventory-changes-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`BatchRetrieveInventoryChangesResponse`](../../doc/models/batch-retrieve-inventory-changes-response.md) + +## Example Usage + +```ts +const body: BatchRetrieveInventoryChangesRequest = { + catalogObjectIds: [ + 'W62UWFY35CWMYGVWK6TWJDNI' + ], + locationIds: [ + 'C6W5YS5QM06F5' + ], + types: [ + 'PHYSICAL_COUNT' + ], + states: [ + 'IN_STOCK' + ], + updatedAfter: '2016-11-01T00:00:00.000Z', + updatedBefore: '2016-12-01T00:00:00.000Z', +}; + +try { + const { result, ...httpResponse } = await inventoryApi.deprecatedBatchRetrieveInventoryChanges(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Deprecated Batch Retrieve Inventory Counts + +**This endpoint is deprecated.** + +Deprecated version of [BatchRetrieveInventoryCounts](api-endpoint:Inventory-BatchRetrieveInventoryCounts) after the endpoint URL +is updated to conform to the standard convention. + +```ts +async deprecatedBatchRetrieveInventoryCounts( + body: BatchRetrieveInventoryCountsRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BatchRetrieveInventoryCountsRequest`](../../doc/models/batch-retrieve-inventory-counts-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`BatchRetrieveInventoryCountsResponse`](../../doc/models/batch-retrieve-inventory-counts-response.md) + +## Example Usage + +```ts +const body: BatchRetrieveInventoryCountsRequest = { + catalogObjectIds: [ + 'W62UWFY35CWMYGVWK6TWJDNI' + ], + locationIds: [ + '59TNP9SA8VGDA' + ], + updatedAfter: '2016-11-16T00:00:00.000Z', +}; + +try { + const { result, ...httpResponse } = await inventoryApi.deprecatedBatchRetrieveInventoryCounts(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Batch Change Inventory + +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. + +```ts +async batchChangeInventory( + body: BatchChangeInventoryRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BatchChangeInventoryRequest`](../../doc/models/batch-change-inventory-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`BatchChangeInventoryResponse`](../../doc/models/batch-change-inventory-response.md) + +## Example Usage + +```ts +const body: BatchChangeInventoryRequest = { + idempotencyKey: '8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe', + changes: [ + { + type: 'PHYSICAL_COUNT', + physicalCount: { + referenceId: '1536bfbf-efed-48bf-b17d-a197141b2a92', + catalogObjectId: 'W62UWFY35CWMYGVWK6TWJDNI', + state: 'IN_STOCK', + locationId: 'C6W5YS5QM06F5', + quantity: '53', + teamMemberId: 'LRK57NSQ5X7PUD05', + occurredAt: '2016-11-16T22:25:24.878Z', + }, + } + ], + ignoreUnchangedCounts: true, +}; + +try { + const { result, ...httpResponse } = await inventoryApi.batchChangeInventory(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Batch Retrieve Inventory Changes + +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. + +```ts +async batchRetrieveInventoryChanges( + body: BatchRetrieveInventoryChangesRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BatchRetrieveInventoryChangesRequest`](../../doc/models/batch-retrieve-inventory-changes-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`BatchRetrieveInventoryChangesResponse`](../../doc/models/batch-retrieve-inventory-changes-response.md) + +## Example Usage + +```ts +const body: BatchRetrieveInventoryChangesRequest = { + catalogObjectIds: [ + 'W62UWFY35CWMYGVWK6TWJDNI' + ], + locationIds: [ + 'C6W5YS5QM06F5' + ], + types: [ + 'PHYSICAL_COUNT' + ], + states: [ + 'IN_STOCK' + ], + updatedAfter: '2016-11-01T00:00:00.000Z', + updatedBefore: '2016-12-01T00:00:00.000Z', +}; + +try { + const { result, ...httpResponse } = await inventoryApi.batchRetrieveInventoryChanges(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Batch Retrieve Inventory Counts + +Returns current counts for the provided +[CatalogObject](../../doc/models/catalog-object.md)s at the requested +[Location](../../doc/models/location.md)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. + +```ts +async batchRetrieveInventoryCounts( + body: BatchRetrieveInventoryCountsRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BatchRetrieveInventoryCountsRequest`](../../doc/models/batch-retrieve-inventory-counts-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`BatchRetrieveInventoryCountsResponse`](../../doc/models/batch-retrieve-inventory-counts-response.md) + +## Example Usage + +```ts +const body: BatchRetrieveInventoryCountsRequest = { + catalogObjectIds: [ + 'W62UWFY35CWMYGVWK6TWJDNI' + ], + locationIds: [ + '59TNP9SA8VGDA' + ], + updatedAfter: '2016-11-16T00:00:00.000Z', +}; + +try { + const { result, ...httpResponse } = await inventoryApi.batchRetrieveInventoryCounts(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Deprecated Retrieve Inventory Physical Count + +**This endpoint is deprecated.** + +Deprecated version of [RetrieveInventoryPhysicalCount](api-endpoint:Inventory-RetrieveInventoryPhysicalCount) after the endpoint URL +is updated to conform to the standard convention. + +```ts +async deprecatedRetrieveInventoryPhysicalCount( + physicalCountId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `physicalCountId` | `string` | Template, Required | ID of the
[InventoryPhysicalCount](entity:InventoryPhysicalCount) to retrieve. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveInventoryPhysicalCountResponse`](../../doc/models/retrieve-inventory-physical-count-response.md) + +## Example Usage + +```ts +const physicalCountId = 'physical_count_id2'; + +try { + const { result, ...httpResponse } = await inventoryApi.deprecatedRetrieveInventoryPhysicalCount(physicalCountId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Inventory Physical Count + +Returns the [InventoryPhysicalCount](../../doc/models/inventory-physical-count.md) +object with the provided `physical_count_id`. + +```ts +async retrieveInventoryPhysicalCount( + physicalCountId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `physicalCountId` | `string` | Template, Required | ID of the
[InventoryPhysicalCount](entity:InventoryPhysicalCount) to retrieve. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveInventoryPhysicalCountResponse`](../../doc/models/retrieve-inventory-physical-count-response.md) + +## Example Usage + +```ts +const physicalCountId = 'physical_count_id2'; + +try { + const { result, ...httpResponse } = await inventoryApi.retrieveInventoryPhysicalCount(physicalCountId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Inventory Transfer + +Returns the [InventoryTransfer](../../doc/models/inventory-transfer.md) object +with the provided `transfer_id`. + +```ts +async retrieveInventoryTransfer( + transferId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `transferId` | `string` | Template, Required | ID of the [InventoryTransfer](entity:InventoryTransfer) to retrieve. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveInventoryTransferResponse`](../../doc/models/retrieve-inventory-transfer-response.md) + +## Example Usage + +```ts +const transferId = 'transfer_id6'; + +try { + const { result, ...httpResponse } = await inventoryApi.retrieveInventoryTransfer(transferId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Inventory Count + +Retrieves the current calculated stock count for a given +[CatalogObject](../../doc/models/catalog-object.md) at a given set of +[Location](../../doc/models/location.md)s. Responses are paginated and unsorted. +For more sophisticated queries, use a batch endpoint. + +```ts +async retrieveInventoryCount( + catalogObjectId: string, + locationIds?: string, + cursor?: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `catalogObjectId` | `string` | Template, Required | ID of the [CatalogObject](entity:CatalogObject) to retrieve. | +| `locationIds` | `string \| undefined` | Query, Optional | The [Location](entity:Location) IDs to look up as a comma-separated
list. An empty list queries all locations. | +| `cursor` | `string \| undefined` | Query, Optional | 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. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveInventoryCountResponse`](../../doc/models/retrieve-inventory-count-response.md) + +## Example Usage + +```ts +const catalogObjectId = 'catalog_object_id6'; + +try { + const { result, ...httpResponse } = await inventoryApi.retrieveInventoryCount(catalogObjectId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Inventory Changes + +**This endpoint is deprecated.** + +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. + +```ts +async retrieveInventoryChanges( + catalogObjectId: string, + locationIds?: string, + cursor?: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `catalogObjectId` | `string` | Template, Required | ID of the [CatalogObject](entity:CatalogObject) to retrieve. | +| `locationIds` | `string \| undefined` | Query, Optional | The [Location](entity:Location) IDs to look up as a comma-separated
list. An empty list queries all locations. | +| `cursor` | `string \| undefined` | Query, Optional | 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. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveInventoryChangesResponse`](../../doc/models/retrieve-inventory-changes-response.md) + +## Example Usage + +```ts +const catalogObjectId = 'catalog_object_id6'; + +try { + const { result, ...httpResponse } = await inventoryApi.retrieveInventoryChanges(catalogObjectId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/invoices.md b/legacy/doc/api/invoices.md new file mode 100644 index 000000000..dd450a4a1 --- /dev/null +++ b/legacy/doc/api/invoices.md @@ -0,0 +1,596 @@ +# Invoices + +```ts +const invoicesApi = client.invoicesApi; +``` + +## Class Name + +`InvoicesApi` + +## Methods + +* [List Invoices](../../doc/api/invoices.md#list-invoices) +* [Create Invoice](../../doc/api/invoices.md#create-invoice) +* [Search Invoices](../../doc/api/invoices.md#search-invoices) +* [Delete Invoice](../../doc/api/invoices.md#delete-invoice) +* [Get Invoice](../../doc/api/invoices.md#get-invoice) +* [Update Invoice](../../doc/api/invoices.md#update-invoice) +* [Create Invoice Attachment](../../doc/api/invoices.md#create-invoice-attachment) +* [Delete Invoice Attachment](../../doc/api/invoices.md#delete-invoice-attachment) +* [Cancel Invoice](../../doc/api/invoices.md#cancel-invoice) +* [Publish Invoice](../../doc/api/invoices.md#publish-invoice) + + +# List Invoices + +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. + +```ts +async listInvoices( + locationId: string, + cursor?: string, + limit?: number, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string` | Query, Required | The ID of the location for which to list invoices. | +| `cursor` | `string \| undefined` | Query, Optional | 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` | `number \| undefined` | Query, Optional | The maximum number of invoices to return (200 is the maximum `limit`).
If not provided, the server uses a default limit of 100 invoices. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListInvoicesResponse`](../../doc/models/list-invoices-response.md) + +## Example Usage + +```ts +const locationId = 'location_id4'; + +try { + const { result, ...httpResponse } = await invoicesApi.listInvoices(locationId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Create Invoice + +Creates a draft [invoice](../../doc/models/invoice.md) +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). + +```ts +async createInvoice( + body: CreateInvoiceRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`CreateInvoiceRequest`](../../doc/models/create-invoice-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CreateInvoiceResponse`](../../doc/models/create-invoice-response.md) + +## Example Usage + +```ts +const body: CreateInvoiceRequest = { + invoice: { + locationId: 'ES0RJRZYEC39A', + orderId: 'CAISENgvlJ6jLWAzERDzjyHVybY', + primaryRecipient: { + customerId: 'JDKYHBWT1D4F8MFH63DBMEN8Y4', + }, + paymentRequests: [ + { + requestType: 'BALANCE', + dueDate: '2030-01-24', + tippingEnabled: true, + automaticPaymentSource: 'NONE', + reminders: [ + { + relativeScheduledDays: -1, + message: 'Your invoice is due tomorrow', + } + ], + } + ], + deliveryMethod: 'EMAIL', + invoiceNumber: 'inv-100', + title: 'Event Planning Services', + description: 'We appreciate your business!', + scheduledAt: '2030-01-13T10:00:00Z', + 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', + } + ], + saleOrServiceDate: '2030-01-24', + storePaymentMethodEnabled: false, + }, + idempotencyKey: 'ce3748f9-5fc1-4762-aa12-aae5e843f1f4', +}; + +try { + const { result, ...httpResponse } = await invoicesApi.createInvoice(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Search Invoices + +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. + +```ts +async searchInvoices( + body: SearchInvoicesRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`SearchInvoicesRequest`](../../doc/models/search-invoices-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`SearchInvoicesResponse`](../../doc/models/search-invoices-response.md) + +## Example Usage + +```ts +const body: SearchInvoicesRequest = { + query: { + filter: { + locationIds: [ + 'ES0RJRZYEC39A' + ], + customerIds: [ + 'JDKYHBWT1D4F8MFH63DBMEN8Y4' + ], + }, + sort: { + field: 'INVOICE_SORT_DATE', + order: 'DESC', + }, + }, +}; + +try { + const { result, ...httpResponse } = await invoicesApi.searchInvoices(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Delete Invoice + +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). + +```ts +async deleteInvoice( + invoiceId: string, + version?: number, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `invoiceId` | `string` | Template, Required | The ID of the invoice to delete. | +| `version` | `number \| undefined` | Query, Optional | 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). | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`DeleteInvoiceResponse`](../../doc/models/delete-invoice-response.md) + +## Example Usage + +```ts +const invoiceId = 'invoice_id0'; + +try { + const { result, ...httpResponse } = await invoicesApi.deleteInvoice(invoiceId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Get Invoice + +Retrieves an invoice by invoice ID. + +```ts +async getInvoice( + invoiceId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `invoiceId` | `string` | Template, Required | The ID of the invoice to retrieve. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`GetInvoiceResponse`](../../doc/models/get-invoice-response.md) + +## Example Usage + +```ts +const invoiceId = 'invoice_id0'; + +try { + const { result, ...httpResponse } = await invoicesApi.getInvoice(invoiceId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Update Invoice + +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. + +```ts +async updateInvoice( + invoiceId: string, + body: UpdateInvoiceRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `invoiceId` | `string` | Template, Required | The ID of the invoice to update. | +| `body` | [`UpdateInvoiceRequest`](../../doc/models/update-invoice-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`UpdateInvoiceResponse`](../../doc/models/update-invoice-response.md) + +## Example Usage + +```ts +const invoiceId = 'invoice_id0'; + +const body: UpdateInvoiceRequest = { + invoice: { + version: 1, + paymentRequests: [ + { + uid: '2da7964f-f3d2-4f43-81e8-5aa220bf3355', + tippingEnabled: false, + reminders: [ + { + }, + { + }, + { + } + ], + } + ], + }, + idempotencyKey: '4ee82288-0910-499e-ab4c-5d0071dad1be', +}; + +try { + const { result, ...httpResponse } = await invoicesApi.updateInvoice( + invoiceId, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Create Invoice Attachment + +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. + +```ts +async createInvoiceAttachment( + invoiceId: string, + request?: CreateInvoiceAttachmentRequest, + imageFile?: FileWrapper, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `invoiceId` | `string` | Template, Required | The ID of the [invoice](entity:Invoice) to attach the file to. | +| `request` | [`CreateInvoiceAttachmentRequest \| undefined`](../../doc/models/create-invoice-attachment-request.md) | Form (JSON-Encoded), Optional | Represents a [CreateInvoiceAttachment](../../doc/api/invoices.md#create-invoice-attachment) request. | +| `imageFile` | `FileWrapper \| undefined` | Form, Optional | - | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CreateInvoiceAttachmentResponse`](../../doc/models/create-invoice-attachment-response.md) + +## Example Usage + +```ts +const invoiceId = 'invoice_id0'; + +const request: CreateInvoiceAttachmentRequest = { + idempotencyKey: 'ae5e84f9-4742-4fc1-ba12-a3ce3748f1c3', + description: 'Service contract', +}; + +try { + const { result, ...httpResponse } = await invoicesApi.createInvoiceAttachment( + invoiceId, + request +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Delete Invoice Attachment + +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. + +```ts +async deleteInvoiceAttachment( + invoiceId: string, + attachmentId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `invoiceId` | `string` | Template, Required | The ID of the [invoice](entity:Invoice) to delete the attachment from. | +| `attachmentId` | `string` | Template, Required | The ID of the [attachment](entity:InvoiceAttachment) to delete. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`DeleteInvoiceAttachmentResponse`](../../doc/models/delete-invoice-attachment-response.md) + +## Example Usage + +```ts +const invoiceId = 'invoice_id0'; + +const attachmentId = 'attachment_id6'; + +try { + const { result, ...httpResponse } = await invoicesApi.deleteInvoiceAttachment( + invoiceId, + attachmentId +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Cancel Invoice + +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`. + +```ts +async cancelInvoice( + invoiceId: string, + body: CancelInvoiceRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `invoiceId` | `string` | Template, Required | The ID of the [invoice](entity:Invoice) to cancel. | +| `body` | [`CancelInvoiceRequest`](../../doc/models/cancel-invoice-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CancelInvoiceResponse`](../../doc/models/cancel-invoice-response.md) + +## Example Usage + +```ts +const invoiceId = 'invoice_id0'; + +const body: CancelInvoiceRequest = { + version: 0, +}; + +try { + const { result, ...httpResponse } = await invoicesApi.cancelInvoice( + invoiceId, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Publish 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. + +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. + +```ts +async publishInvoice( + invoiceId: string, + body: PublishInvoiceRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `invoiceId` | `string` | Template, Required | The ID of the invoice to publish. | +| `body` | [`PublishInvoiceRequest`](../../doc/models/publish-invoice-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`PublishInvoiceResponse`](../../doc/models/publish-invoice-response.md) + +## Example Usage + +```ts +const invoiceId = 'invoice_id0'; + +const body: PublishInvoiceRequest = { + version: 1, + idempotencyKey: '32da42d0-1997-41b0-826b-f09464fc2c2e', +}; + +try { + const { result, ...httpResponse } = await invoicesApi.publishInvoice( + invoiceId, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/labor.md b/legacy/doc/api/labor.md new file mode 100644 index 000000000..07260f848 --- /dev/null +++ b/legacy/doc/api/labor.md @@ -0,0 +1,851 @@ +# Labor + +```ts +const laborApi = client.laborApi; +``` + +## Class Name + +`LaborApi` + +## Methods + +* [List Break Types](../../doc/api/labor.md#list-break-types) +* [Create Break Type](../../doc/api/labor.md#create-break-type) +* [Delete Break Type](../../doc/api/labor.md#delete-break-type) +* [Get Break Type](../../doc/api/labor.md#get-break-type) +* [Update Break Type](../../doc/api/labor.md#update-break-type) +* [List Employee Wages](../../doc/api/labor.md#list-employee-wages) +* [Get Employee Wage](../../doc/api/labor.md#get-employee-wage) +* [Create Shift](../../doc/api/labor.md#create-shift) +* [Search Shifts](../../doc/api/labor.md#search-shifts) +* [Delete Shift](../../doc/api/labor.md#delete-shift) +* [Get Shift](../../doc/api/labor.md#get-shift) +* [Update Shift](../../doc/api/labor.md#update-shift) +* [List Team Member Wages](../../doc/api/labor.md#list-team-member-wages) +* [Get Team Member Wage](../../doc/api/labor.md#get-team-member-wage) +* [List Workweek Configs](../../doc/api/labor.md#list-workweek-configs) +* [Update Workweek Config](../../doc/api/labor.md#update-workweek-config) + + +# List Break Types + +Returns a paginated list of `BreakType` instances for a business. + +```ts +async listBreakTypes( + locationId?: string, + limit?: number, + cursor?: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string \| undefined` | Query, Optional | Filter the returned `BreakType` results to only those that are associated with the
specified location. | +| `limit` | `number \| undefined` | Query, Optional | The maximum number of `BreakType` results to return per page. The number can range between 1
and 200. The default is 200. | +| `cursor` | `string \| undefined` | Query, Optional | A pointer to the next page of `BreakType` results to fetch. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListBreakTypesResponse`](../../doc/models/list-break-types-response.md) + +## Example Usage + +```ts +try { + const { result, ...httpResponse } = await laborApi.listBreakTypes(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Create Break Type + +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. + +```ts +async createBreakType( + body: CreateBreakTypeRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`CreateBreakTypeRequest`](../../doc/models/create-break-type-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CreateBreakTypeResponse`](../../doc/models/create-break-type-response.md) + +## Example Usage + +```ts +const body: CreateBreakTypeRequest = { + breakType: { + locationId: 'CGJN03P1D08GF', + breakName: 'Lunch Break', + expectedDuration: 'PT30M', + isPaid: true, + }, + idempotencyKey: 'PAD3NG5KSN2GL', +}; + +try { + const { result, ...httpResponse } = await laborApi.createBreakType(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Delete Break Type + +Deletes an existing `BreakType`. + +A `BreakType` can be deleted even if it is referenced from a `Shift`. + +```ts +async deleteBreakType( + id: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string` | Template, Required | The UUID for the `BreakType` being deleted. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`DeleteBreakTypeResponse`](../../doc/models/delete-break-type-response.md) + +## Example Usage + +```ts +const id = 'id0'; + +try { + const { result, ...httpResponse } = await laborApi.deleteBreakType(id); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Get Break Type + +Returns a single `BreakType` specified by `id`. + +```ts +async getBreakType( + id: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string` | Template, Required | The UUID for the `BreakType` being retrieved. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`GetBreakTypeResponse`](../../doc/models/get-break-type-response.md) + +## Example Usage + +```ts +const id = 'id0'; + +try { + const { result, ...httpResponse } = await laborApi.getBreakType(id); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Update Break Type + +Updates an existing `BreakType`. + +```ts +async updateBreakType( + id: string, + body: UpdateBreakTypeRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string` | Template, Required | The UUID for the `BreakType` being updated. | +| `body` | [`UpdateBreakTypeRequest`](../../doc/models/update-break-type-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`UpdateBreakTypeResponse`](../../doc/models/update-break-type-response.md) + +## Example Usage + +```ts +const id = 'id0'; + +const body: UpdateBreakTypeRequest = { + breakType: { + locationId: '26M7H24AZ9N6R', + breakName: 'Lunch', + expectedDuration: 'PT50M', + isPaid: true, + version: 1, + }, +}; + +try { + const { result, ...httpResponse } = await laborApi.updateBreakType( + id, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# List Employee Wages + +**This endpoint is deprecated.** + +Returns a paginated list of `EmployeeWage` instances for a business. + +```ts +async listEmployeeWages( + employeeId?: string, + limit?: number, + cursor?: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `employeeId` | `string \| undefined` | Query, Optional | Filter the returned wages to only those that are associated with the specified employee. | +| `limit` | `number \| undefined` | Query, Optional | The maximum number of `EmployeeWage` results to return per page. The number can range between
1 and 200. The default is 200. | +| `cursor` | `string \| undefined` | Query, Optional | A pointer to the next page of `EmployeeWage` results to fetch. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListEmployeeWagesResponse`](../../doc/models/list-employee-wages-response.md) + +## Example Usage + +```ts +try { + const { result, ...httpResponse } = await laborApi.listEmployeeWages(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Get Employee Wage + +**This endpoint is deprecated.** + +Returns a single `EmployeeWage` specified by `id`. + +```ts +async getEmployeeWage( + id: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string` | Template, Required | The UUID for the `EmployeeWage` being retrieved. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`GetEmployeeWageResponse`](../../doc/models/get-employee-wage-response.md) + +## Example Usage + +```ts +const id = 'id0'; + +try { + const { result, ...httpResponse } = await laborApi.getEmployeeWage(id); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Create Shift + +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. + +```ts +async createShift( + body: CreateShiftRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`CreateShiftRequest`](../../doc/models/create-shift-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CreateShiftResponse`](../../doc/models/create-shift-response.md) + +## Example Usage + +```ts +const body: CreateShiftRequest = { + shift: { + locationId: 'PAA1RJZZKXBFG', + startAt: '2019-01-25T03:11:00-05:00', + endAt: '2019-01-25T13:11:00-05:00', + wage: { + title: 'Barista', + hourlyRate: { + amount: BigInt(1100), + currency: 'USD', + }, + tipEligible: true, + }, + breaks: [ + { + startAt: '2019-01-25T06:11:00-05:00', + breakTypeId: 'REGS1EQR1TPZ5', + name: 'Tea Break', + expectedDuration: 'PT5M', + isPaid: true, + endAt: '2019-01-25T06:16:00-05:00', + } + ], + teamMemberId: 'ormj0jJJZ5OZIzxrZYJI', + declaredCashTipMoney: { + amount: BigInt(500), + currency: 'USD', + }, + }, + idempotencyKey: 'HIDSNG5KS478L', +}; + +try { + const { result, ...httpResponse } = await laborApi.createShift(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Search Shifts + +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` + +```ts +async searchShifts( + body: SearchShiftsRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`SearchShiftsRequest`](../../doc/models/search-shifts-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`SearchShiftsResponse`](../../doc/models/search-shifts-response.md) + +## Example Usage + +```ts +const body: SearchShiftsRequest = { + query: { + filter: { + workday: { + dateRange: { + startDate: '2019-01-20', + endDate: '2019-02-03', + }, + matchShiftsBy: 'START_AT', + defaultTimezone: 'America/Los_Angeles', + }, + }, + }, + limit: 100, +}; + +try { + const { result, ...httpResponse } = await laborApi.searchShifts(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Delete Shift + +Deletes a `Shift`. + +```ts +async deleteShift( + id: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string` | Template, Required | The UUID for the `Shift` being deleted. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`DeleteShiftResponse`](../../doc/models/delete-shift-response.md) + +## Example Usage + +```ts +const id = 'id0'; + +try { + const { result, ...httpResponse } = await laborApi.deleteShift(id); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Get Shift + +Returns a single `Shift` specified by `id`. + +```ts +async getShift( + id: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string` | Template, Required | The UUID for the `Shift` being retrieved. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`GetShiftResponse`](../../doc/models/get-shift-response.md) + +## Example Usage + +```ts +const id = 'id0'; + +try { + const { result, ...httpResponse } = await laborApi.getShift(id); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Update Shift + +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`. + +```ts +async updateShift( + id: string, + body: UpdateShiftRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string` | Template, Required | The ID of the object being updated. | +| `body` | [`UpdateShiftRequest`](../../doc/models/update-shift-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`UpdateShiftResponse`](../../doc/models/update-shift-response.md) + +## Example Usage + +```ts +const id = 'id0'; + +const body: UpdateShiftRequest = { + shift: { + locationId: 'PAA1RJZZKXBFG', + startAt: '2019-01-25T03:11:00-05:00', + endAt: '2019-01-25T13:11:00-05:00', + wage: { + title: 'Bartender', + hourlyRate: { + amount: BigInt(1500), + currency: 'USD', + }, + tipEligible: true, + }, + breaks: [ + { + startAt: '2019-01-25T06:11:00-05:00', + breakTypeId: 'REGS1EQR1TPZ5', + name: 'Tea Break', + expectedDuration: 'PT5M', + isPaid: true, + id: 'X7GAQYVVRRG6P', + endAt: '2019-01-25T06:16:00-05:00', + } + ], + version: 1, + teamMemberId: 'ormj0jJJZ5OZIzxrZYJI', + declaredCashTipMoney: { + amount: BigInt(500), + currency: 'USD', + }, + }, +}; + +try { + const { result, ...httpResponse } = await laborApi.updateShift( + id, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# List Team Member Wages + +Returns a paginated list of `TeamMemberWage` instances for a business. + +```ts +async listTeamMemberWages( + teamMemberId?: string, + limit?: number, + cursor?: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `teamMemberId` | `string \| undefined` | Query, Optional | Filter the returned wages to only those that are associated with the
specified team member. | +| `limit` | `number \| undefined` | Query, Optional | The maximum number of `TeamMemberWage` results to return per page. The number can range between
1 and 200. The default is 200. | +| `cursor` | `string \| undefined` | Query, Optional | A pointer to the next page of `EmployeeWage` results to fetch. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListTeamMemberWagesResponse`](../../doc/models/list-team-member-wages-response.md) + +## Example Usage + +```ts +try { + const { result, ...httpResponse } = await laborApi.listTeamMemberWages(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Get Team Member Wage + +Returns a single `TeamMemberWage` specified by `id`. + +```ts +async getTeamMemberWage( + id: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string` | Template, Required | The UUID for the `TeamMemberWage` being retrieved. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`GetTeamMemberWageResponse`](../../doc/models/get-team-member-wage-response.md) + +## Example Usage + +```ts +const id = 'id0'; + +try { + const { result, ...httpResponse } = await laborApi.getTeamMemberWage(id); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# List Workweek Configs + +Returns a list of `WorkweekConfig` instances for a business. + +```ts +async listWorkweekConfigs( + limit?: number, + cursor?: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `limit` | `number \| undefined` | Query, Optional | The maximum number of `WorkweekConfigs` results to return per page. | +| `cursor` | `string \| undefined` | Query, Optional | A pointer to the next page of `WorkweekConfig` results to fetch. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListWorkweekConfigsResponse`](../../doc/models/list-workweek-configs-response.md) + +## Example Usage + +```ts +try { + const { result, ...httpResponse } = await laborApi.listWorkweekConfigs(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Update Workweek Config + +Updates a `WorkweekConfig`. + +```ts +async updateWorkweekConfig( + id: string, + body: UpdateWorkweekConfigRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string` | Template, Required | The UUID for the `WorkweekConfig` object being updated. | +| `body` | [`UpdateWorkweekConfigRequest`](../../doc/models/update-workweek-config-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`UpdateWorkweekConfigResponse`](../../doc/models/update-workweek-config-response.md) + +## Example Usage + +```ts +const id = 'id0'; + +const body: UpdateWorkweekConfigRequest = { + workweekConfig: { + startOfWeek: 'MON', + startOfDayLocalTime: '10:00', + version: 10, + }, +}; + +try { + const { result, ...httpResponse } = await laborApi.updateWorkweekConfig( + id, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/location-custom-attributes.md b/legacy/doc/api/location-custom-attributes.md new file mode 100644 index 000000000..9fc777f78 --- /dev/null +++ b/legacy/doc/api/location-custom-attributes.md @@ -0,0 +1,605 @@ +# Location Custom Attributes + +```ts +const locationCustomAttributesApi = client.locationCustomAttributesApi; +``` + +## Class Name + +`LocationCustomAttributesApi` + +## Methods + +* [List Location Custom Attribute Definitions](../../doc/api/location-custom-attributes.md#list-location-custom-attribute-definitions) +* [Create Location Custom Attribute Definition](../../doc/api/location-custom-attributes.md#create-location-custom-attribute-definition) +* [Delete Location Custom Attribute Definition](../../doc/api/location-custom-attributes.md#delete-location-custom-attribute-definition) +* [Retrieve Location Custom Attribute Definition](../../doc/api/location-custom-attributes.md#retrieve-location-custom-attribute-definition) +* [Update Location Custom Attribute Definition](../../doc/api/location-custom-attributes.md#update-location-custom-attribute-definition) +* [Bulk Delete Location Custom Attributes](../../doc/api/location-custom-attributes.md#bulk-delete-location-custom-attributes) +* [Bulk Upsert Location Custom Attributes](../../doc/api/location-custom-attributes.md#bulk-upsert-location-custom-attributes) +* [List Location Custom Attributes](../../doc/api/location-custom-attributes.md#list-location-custom-attributes) +* [Delete Location Custom Attribute](../../doc/api/location-custom-attributes.md#delete-location-custom-attribute) +* [Retrieve Location Custom Attribute](../../doc/api/location-custom-attributes.md#retrieve-location-custom-attribute) +* [Upsert Location Custom Attribute](../../doc/api/location-custom-attributes.md#upsert-location-custom-attribute) + + +# List Location Custom Attribute Definitions + +Lists the location-related [custom attribute definitions](../../doc/models/custom-attribute-definition.md) 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`. + +```ts +async listLocationCustomAttributeDefinitions( + visibilityFilter?: string, + limit?: number, + cursor?: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `visibilityFilter` | [`string \| undefined`](../../doc/models/visibility-filter.md) | Query, Optional | Filters the `CustomAttributeDefinition` results by their `visibility` values. | +| `limit` | `number \| undefined` | Query, Optional | 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` | `string \| undefined` | Query, Optional | 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). | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListLocationCustomAttributeDefinitionsResponse`](../../doc/models/list-location-custom-attribute-definitions-response.md) + +## Example Usage + +```ts +try { + const { result, ...httpResponse } = await locationCustomAttributesApi.listLocationCustomAttributeDefinitions(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Create Location Custom Attribute Definition + +Creates a location-related [custom attribute definition](../../doc/models/custom-attribute-definition.md) 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](../../doc/api/location-custom-attributes.md#upsert-location-custom-attribute) or +[BulkUpsertLocationCustomAttributes](../../doc/api/location-custom-attributes.md#bulk-upsert-location-custom-attributes) +to set the custom attribute for locations. + +```ts +async createLocationCustomAttributeDefinition( + body: CreateLocationCustomAttributeDefinitionRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`CreateLocationCustomAttributeDefinitionRequest`](../../doc/models/create-location-custom-attribute-definition-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CreateLocationCustomAttributeDefinitionResponse`](../../doc/models/create-location-custom-attribute-definition-response.md) + +## Example Usage + +```ts +const body: CreateLocationCustomAttributeDefinitionRequest = { + customAttributeDefinition: { + key: 'bestseller', + name: 'Bestseller', + description: 'Bestselling item at location', + visibility: 'VISIBILITY_READ_WRITE_VALUES', + }, +}; + +try { + const { result, ...httpResponse } = await locationCustomAttributesApi.createLocationCustomAttributeDefinition(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Delete Location Custom Attribute Definition + +Deletes a location-related [custom attribute definition](../../doc/models/custom-attribute-definition.md) 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. + +```ts +async deleteLocationCustomAttributeDefinition( + key: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `key` | `string` | Template, Required | The key of the custom attribute definition to delete. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`DeleteLocationCustomAttributeDefinitionResponse`](../../doc/models/delete-location-custom-attribute-definition-response.md) + +## Example Usage + +```ts +const key = 'key0'; + +try { + const { result, ...httpResponse } = await locationCustomAttributesApi.deleteLocationCustomAttributeDefinition(key); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Location Custom Attribute Definition + +Retrieves a location-related [custom attribute definition](../../doc/models/custom-attribute-definition.md) 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`. + +```ts +async retrieveLocationCustomAttributeDefinition( + key: string, + version?: number, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `key` | `string` | Template, Required | The key of the custom attribute definition to retrieve. If the requesting application
is not the definition owner, you must use the qualified key. | +| `version` | `number \| undefined` | Query, Optional | 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. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveLocationCustomAttributeDefinitionResponse`](../../doc/models/retrieve-location-custom-attribute-definition-response.md) + +## Example Usage + +```ts +const key = 'key0'; + +try { + const { result, ...httpResponse } = await locationCustomAttributesApi.retrieveLocationCustomAttributeDefinition(key); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Update Location Custom Attribute Definition + +Updates a location-related [custom attribute definition](../../doc/models/custom-attribute-definition.md) 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. + +```ts +async updateLocationCustomAttributeDefinition( + key: string, + body: UpdateLocationCustomAttributeDefinitionRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `key` | `string` | Template, Required | The key of the custom attribute definition to update. | +| `body` | [`UpdateLocationCustomAttributeDefinitionRequest`](../../doc/models/update-location-custom-attribute-definition-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`UpdateLocationCustomAttributeDefinitionResponse`](../../doc/models/update-location-custom-attribute-definition-response.md) + +## Example Usage + +```ts +const key = 'key0'; + +const body: UpdateLocationCustomAttributeDefinitionRequest = { + customAttributeDefinition: { + description: 'Update the description as desired.', + visibility: 'VISIBILITY_READ_ONLY', + }, +}; + +try { + const { result, ...httpResponse } = await locationCustomAttributesApi.updateLocationCustomAttributeDefinition( + key, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Bulk Delete Location Custom Attributes + +Deletes [custom attributes](../../doc/models/custom-attribute.md) for locations as a bulk operation. +To delete a custom attribute owned by another application, the `visibility` setting must be +`VISIBILITY_READ_WRITE_VALUES`. + +```ts +async bulkDeleteLocationCustomAttributes( + body: BulkDeleteLocationCustomAttributesRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BulkDeleteLocationCustomAttributesRequest`](../../doc/models/bulk-delete-location-custom-attributes-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`BulkDeleteLocationCustomAttributesResponse`](../../doc/models/bulk-delete-location-custom-attributes-response.md) + +## Example Usage + +```ts +const body: BulkDeleteLocationCustomAttributesRequest = { + values: { + 'id1': { + }, + 'id2': { + }, + 'id3': { + } + }, +}; + +try { + const { result, ...httpResponse } = await locationCustomAttributesApi.bulkDeleteLocationCustomAttributes(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Bulk Upsert Location Custom Attributes + +Creates or updates [custom attributes](../../doc/models/custom-attribute.md) 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](../../doc/api/location-custom-attributes.md#create-location-custom-attribute-definition) 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`. + +```ts +async bulkUpsertLocationCustomAttributes( + body: BulkUpsertLocationCustomAttributesRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BulkUpsertLocationCustomAttributesRequest`](../../doc/models/bulk-upsert-location-custom-attributes-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`BulkUpsertLocationCustomAttributesResponse`](../../doc/models/bulk-upsert-location-custom-attributes-response.md) + +## Example Usage + +```ts +const body: BulkUpsertLocationCustomAttributesRequest = { + values: { + 'key0': { + locationId: 'location_id4', + customAttribute: { + }, + }, + 'key1': { + locationId: 'location_id4', + customAttribute: { + }, + } + }, +}; + +try { + const { result, ...httpResponse } = await locationCustomAttributesApi.bulkUpsertLocationCustomAttributes(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# List Location Custom Attributes + +Lists the [custom attributes](../../doc/models/custom-attribute.md) 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`. + +```ts +async listLocationCustomAttributes( + locationId: string, + visibilityFilter?: string, + limit?: number, + cursor?: string, + withDefinitions?: boolean, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string` | Template, Required | The ID of the target [location](entity:Location). | +| `visibilityFilter` | [`string \| undefined`](../../doc/models/visibility-filter.md) | Query, Optional | Filters the `CustomAttributeDefinition` results by their `visibility` values. | +| `limit` | `number \| undefined` | Query, Optional | 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` | `string \| undefined` | Query, Optional | 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). | +| `withDefinitions` | `boolean \| undefined` | Query, Optional | 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`.
**Default**: `false` | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListLocationCustomAttributesResponse`](../../doc/models/list-location-custom-attributes-response.md) + +## Example Usage + +```ts +const locationId = 'location_id4'; + +const withDefinitions = false; + +try { + const { result, ...httpResponse } = await locationCustomAttributesApi.listLocationCustomAttributes( + locationId, + undefined, + undefined, + undefined, + withDefinitions +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Delete Location Custom Attribute + +Deletes a [custom attribute](../../doc/models/custom-attribute.md) associated with a location. +To delete a custom attribute owned by another application, the `visibility` setting must be +`VISIBILITY_READ_WRITE_VALUES`. + +```ts +async deleteLocationCustomAttribute( + locationId: string, + key: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string` | Template, Required | The ID of the target [location](entity:Location). | +| `key` | `string` | Template, Required | 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. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`DeleteLocationCustomAttributeResponse`](../../doc/models/delete-location-custom-attribute-response.md) + +## Example Usage + +```ts +const locationId = 'location_id4'; + +const key = 'key0'; + +try { + const { result, ...httpResponse } = await locationCustomAttributesApi.deleteLocationCustomAttribute( + locationId, + key +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Location Custom Attribute + +Retrieves a [custom attribute](../../doc/models/custom-attribute.md) 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`. + +```ts +async retrieveLocationCustomAttribute( + locationId: string, + key: string, + withDefinition?: boolean, + version?: number, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string` | Template, Required | The ID of the target [location](entity:Location). | +| `key` | `string` | Template, Required | 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. | +| `withDefinition` | `boolean \| undefined` | Query, Optional | 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`.
**Default**: `false` | +| `version` | `number \| undefined` | Query, Optional | 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. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveLocationCustomAttributeResponse`](../../doc/models/retrieve-location-custom-attribute-response.md) + +## Example Usage + +```ts +const locationId = 'location_id4'; + +const key = 'key0'; + +const withDefinition = false; + +try { + const { result, ...httpResponse } = await locationCustomAttributesApi.retrieveLocationCustomAttribute( + locationId, + key, + withDefinition +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Upsert Location Custom Attribute + +Creates or updates a [custom attribute](../../doc/models/custom-attribute.md) 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](../../doc/api/location-custom-attributes.md#create-location-custom-attribute-definition) endpoint. +To create or update a custom attribute owned by another application, the `visibility` setting +must be `VISIBILITY_READ_WRITE_VALUES`. + +```ts +async upsertLocationCustomAttribute( + locationId: string, + key: string, + body: UpsertLocationCustomAttributeRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string` | Template, Required | The ID of the target [location](entity:Location). | +| `key` | `string` | Template, Required | 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` | [`UpsertLocationCustomAttributeRequest`](../../doc/models/upsert-location-custom-attribute-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`UpsertLocationCustomAttributeResponse`](../../doc/models/upsert-location-custom-attribute-response.md) + +## Example Usage + +```ts +const locationId = 'location_id4'; + +const key = 'key0'; + +const body: UpsertLocationCustomAttributeRequest = { + customAttribute: { + }, +}; + +try { + const { result, ...httpResponse } = await locationCustomAttributesApi.upsertLocationCustomAttribute( + locationId, + key, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/locations.md b/legacy/doc/api/locations.md new file mode 100644 index 000000000..4a9bccb00 --- /dev/null +++ b/legacy/doc/api/locations.md @@ -0,0 +1,222 @@ +# Locations + +```ts +const locationsApi = client.locationsApi; +``` + +## Class Name + +`LocationsApi` + +## Methods + +* [List Locations](../../doc/api/locations.md#list-locations) +* [Create Location](../../doc/api/locations.md#create-location) +* [Retrieve Location](../../doc/api/locations.md#retrieve-location) +* [Update Location](../../doc/api/locations.md#update-location) + + +# List Locations + +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`. + +```ts +async listLocations( + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListLocationsResponse`](../../doc/models/list-locations-response.md) + +## Example Usage + +```ts +try { + const { result, ...httpResponse } = await locationsApi.listLocations(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Create Location + +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. + +```ts +async createLocation( + body: CreateLocationRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`CreateLocationRequest`](../../doc/models/create-location-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CreateLocationResponse`](../../doc/models/create-location-response.md) + +## Example Usage + +```ts +const body: CreateLocationRequest = { + location: { + name: 'Midtown', + address: { + addressLine1: '1234 Peachtree St. NE', + locality: 'Atlanta', + administrativeDistrictLevel1: 'GA', + postalCode: '30309', + }, + description: 'Midtown Atlanta store', + }, +}; + +try { + const { result, ...httpResponse } = await locationsApi.createLocation(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Location + +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). + +```ts +async retrieveLocation( + locationId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string` | Template, Required | The ID of the location to retrieve. Specify the string
"main" to return the main location. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveLocationResponse`](../../doc/models/retrieve-location-response.md) + +## Example Usage + +```ts +const locationId = 'location_id4'; + +try { + const { result, ...httpResponse } = await locationsApi.retrieveLocation(locationId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Update Location + +Updates a [location](https://developer.squareup.com/docs/locations-api). + +```ts +async updateLocation( + locationId: string, + body: UpdateLocationRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string` | Template, Required | The ID of the location to update. | +| `body` | [`UpdateLocationRequest`](../../doc/models/update-location-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`UpdateLocationResponse`](../../doc/models/update-location-response.md) + +## Example Usage + +```ts +const locationId = 'location_id4'; + +const body: UpdateLocationRequest = { + location: { + businessHours: { + periods: [ + { + dayOfWeek: 'FRI', + startLocalTime: '07:00', + endLocalTime: '18:00', + }, + { + dayOfWeek: 'SAT', + startLocalTime: '07:00', + endLocalTime: '18:00', + }, + { + dayOfWeek: 'SUN', + startLocalTime: '09:00', + endLocalTime: '15:00', + } + ], + }, + description: 'Midtown Atlanta store - Open weekends', + }, +}; + +try { + const { result, ...httpResponse } = await locationsApi.updateLocation( + locationId, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/loyalty.md b/legacy/doc/api/loyalty.md new file mode 100644 index 000000000..2841c3090 --- /dev/null +++ b/legacy/doc/api/loyalty.md @@ -0,0 +1,976 @@ +# Loyalty + +```ts +const loyaltyApi = client.loyaltyApi; +``` + +## Class Name + +`LoyaltyApi` + +## Methods + +* [Create Loyalty Account](../../doc/api/loyalty.md#create-loyalty-account) +* [Search Loyalty Accounts](../../doc/api/loyalty.md#search-loyalty-accounts) +* [Retrieve Loyalty Account](../../doc/api/loyalty.md#retrieve-loyalty-account) +* [Accumulate Loyalty Points](../../doc/api/loyalty.md#accumulate-loyalty-points) +* [Adjust Loyalty Points](../../doc/api/loyalty.md#adjust-loyalty-points) +* [Search Loyalty Events](../../doc/api/loyalty.md#search-loyalty-events) +* [List Loyalty Programs](../../doc/api/loyalty.md#list-loyalty-programs) +* [Retrieve Loyalty Program](../../doc/api/loyalty.md#retrieve-loyalty-program) +* [Calculate Loyalty Points](../../doc/api/loyalty.md#calculate-loyalty-points) +* [List Loyalty Promotions](../../doc/api/loyalty.md#list-loyalty-promotions) +* [Create Loyalty Promotion](../../doc/api/loyalty.md#create-loyalty-promotion) +* [Retrieve Loyalty Promotion](../../doc/api/loyalty.md#retrieve-loyalty-promotion) +* [Cancel Loyalty Promotion](../../doc/api/loyalty.md#cancel-loyalty-promotion) +* [Create Loyalty Reward](../../doc/api/loyalty.md#create-loyalty-reward) +* [Search Loyalty Rewards](../../doc/api/loyalty.md#search-loyalty-rewards) +* [Delete Loyalty Reward](../../doc/api/loyalty.md#delete-loyalty-reward) +* [Retrieve Loyalty Reward](../../doc/api/loyalty.md#retrieve-loyalty-reward) +* [Redeem Loyalty Reward](../../doc/api/loyalty.md#redeem-loyalty-reward) + + +# Create Loyalty Account + +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. + +```ts +async createLoyaltyAccount( + body: CreateLoyaltyAccountRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`CreateLoyaltyAccountRequest`](../../doc/models/create-loyalty-account-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CreateLoyaltyAccountResponse`](../../doc/models/create-loyalty-account-response.md) + +## Example Usage + +```ts +const body: CreateLoyaltyAccountRequest = { + loyaltyAccount: { + programId: 'd619f755-2d17-41f3-990d-c04ecedd64dd', + mapping: { + phoneNumber: '+14155551234', + }, + }, + idempotencyKey: 'ec78c477-b1c3-4899-a209-a4e71337c996', +}; + +try { + const { result, ...httpResponse } = await loyaltyApi.createLoyaltyAccount(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Search Loyalty Accounts + +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. + +```ts +async searchLoyaltyAccounts( + body: SearchLoyaltyAccountsRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`SearchLoyaltyAccountsRequest`](../../doc/models/search-loyalty-accounts-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`SearchLoyaltyAccountsResponse`](../../doc/models/search-loyalty-accounts-response.md) + +## Example Usage + +```ts +const body: SearchLoyaltyAccountsRequest = { + query: { + mappings: [ + { + phoneNumber: '+14155551234', + } + ], + }, + limit: 10, +}; + +try { + const { result, ...httpResponse } = await loyaltyApi.searchLoyaltyAccounts(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Loyalty Account + +Retrieves a loyalty account. + +```ts +async retrieveLoyaltyAccount( + accountId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `accountId` | `string` | Template, Required | The ID of the [loyalty account](entity:LoyaltyAccount) to retrieve. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveLoyaltyAccountResponse`](../../doc/models/retrieve-loyalty-account-response.md) + +## Example Usage + +```ts +const accountId = 'account_id2'; + +try { + const { result, ...httpResponse } = await loyaltyApi.retrieveLoyaltyAccount(accountId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Accumulate Loyalty Points + +Adds points earned from a purchase to a [loyalty account](../../doc/models/loyalty-account.md). + +- 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](../../doc/models/loyalty-promotion.md). 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](../../doc/api/loyalty.md#calculate-loyalty-points) + 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). + +```ts +async accumulateLoyaltyPoints( + accountId: string, + body: AccumulateLoyaltyPointsRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `accountId` | `string` | Template, Required | The ID of the target [loyalty account](entity:LoyaltyAccount). | +| `body` | [`AccumulateLoyaltyPointsRequest`](../../doc/models/accumulate-loyalty-points-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`AccumulateLoyaltyPointsResponse`](../../doc/models/accumulate-loyalty-points-response.md) + +## Example Usage + +```ts +const accountId = 'account_id2'; + +const body: AccumulateLoyaltyPointsRequest = { + accumulatePoints: { + orderId: 'RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY', + }, + idempotencyKey: '58b90739-c3e8-4b11-85f7-e636d48d72cb', + locationId: 'P034NEENMD09F', +}; + +try { + const { result, ...httpResponse } = await loyaltyApi.accumulateLoyaltyPoints( + accountId, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Adjust Loyalty Points + +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](../../doc/api/loyalty.md#accumulate-loyalty-points) +to add points when a buyer pays for the purchase. + +```ts +async adjustLoyaltyPoints( + accountId: string, + body: AdjustLoyaltyPointsRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `accountId` | `string` | Template, Required | The ID of the target [loyalty account](entity:LoyaltyAccount). | +| `body` | [`AdjustLoyaltyPointsRequest`](../../doc/models/adjust-loyalty-points-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`AdjustLoyaltyPointsResponse`](../../doc/models/adjust-loyalty-points-response.md) + +## Example Usage + +```ts +const accountId = 'account_id2'; + +const body: AdjustLoyaltyPointsRequest = { + idempotencyKey: 'bc29a517-3dc9-450e-aa76-fae39ee849d1', + adjustPoints: { + points: 10, + reason: 'Complimentary points', + }, +}; + +try { + const { result, ...httpResponse } = await loyaltyApi.adjustLoyaltyPoints( + accountId, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Search Loyalty Events + +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. + +```ts +async searchLoyaltyEvents( + body: SearchLoyaltyEventsRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`SearchLoyaltyEventsRequest`](../../doc/models/search-loyalty-events-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`SearchLoyaltyEventsResponse`](../../doc/models/search-loyalty-events-response.md) + +## Example Usage + +```ts +const body: SearchLoyaltyEventsRequest = { + query: { + filter: { + orderFilter: { + orderId: 'PyATxhYLfsMqpVkcKJITPydgEYfZY', + }, + }, + }, + limit: 30, +}; + +try { + const { result, ...httpResponse } = await loyaltyApi.searchLoyaltyEvents(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# List Loyalty Programs + +**This endpoint is deprecated.** + +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`. + +```ts +async listLoyaltyPrograms( + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListLoyaltyProgramsResponse`](../../doc/models/list-loyalty-programs-response.md) + +## Example Usage + +```ts +try { + const { result, ...httpResponse } = await loyaltyApi.listLoyaltyPrograms(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Loyalty Program + +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). + +```ts +async retrieveLoyaltyProgram( + programId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `programId` | `string` | Template, Required | 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. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveLoyaltyProgramResponse`](../../doc/models/retrieve-loyalty-program-response.md) + +## Example Usage + +```ts +const programId = 'program_id0'; + +try { + const { result, ...httpResponse } = await loyaltyApi.retrieveLoyaltyProgram(programId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Calculate Loyalty Points + +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](../../doc/models/loyalty-promotion.md). + +- 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](../../doc/api/loyalty.md#list-loyalty-promotions) 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). + +```ts +async calculateLoyaltyPoints( + programId: string, + body: CalculateLoyaltyPointsRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `programId` | `string` | Template, Required | The ID of the [loyalty program](entity:LoyaltyProgram), which defines the rules for accruing points. | +| `body` | [`CalculateLoyaltyPointsRequest`](../../doc/models/calculate-loyalty-points-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CalculateLoyaltyPointsResponse`](../../doc/models/calculate-loyalty-points-response.md) + +## Example Usage + +```ts +const programId = 'program_id0'; + +const body: CalculateLoyaltyPointsRequest = { + orderId: 'RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY', + loyaltyAccountId: '79b807d2-d786-46a9-933b-918028d7a8c5', +}; + +try { + const { result, ...httpResponse } = await loyaltyApi.calculateLoyaltyPoints( + programId, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# List Loyalty Promotions + +Lists the loyalty promotions associated with a [loyalty program](../../doc/models/loyalty-program.md). +Results are sorted by the `created_at` date in descending order (newest to oldest). + +```ts +async listLoyaltyPromotions( + programId: string, + status?: string, + cursor?: string, + limit?: number, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `programId` | `string` | Template, Required | The ID of the base [loyalty program](entity:LoyaltyProgram). To get the program ID,
call [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) using the `main` keyword. | +| `status` | [`string \| undefined`](../../doc/models/loyalty-promotion-status.md) | Query, Optional | 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` | `string \| undefined` | Query, Optional | 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` | `number \| undefined` | Query, Optional | 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). | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListLoyaltyPromotionsResponse`](../../doc/models/list-loyalty-promotions-response.md) + +## Example Usage + +```ts +const programId = 'program_id0'; + +try { + const { result, ...httpResponse } = await loyaltyApi.listLoyaltyPromotions(programId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Create Loyalty Promotion + +Creates a loyalty promotion for a [loyalty program](../../doc/models/loyalty-program.md). 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. + +```ts +async createLoyaltyPromotion( + programId: string, + body: CreateLoyaltyPromotionRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `programId` | `string` | Template, Required | 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` | [`CreateLoyaltyPromotionRequest`](../../doc/models/create-loyalty-promotion-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CreateLoyaltyPromotionResponse`](../../doc/models/create-loyalty-promotion-response.md) + +## Example Usage + +```ts +const programId = 'program_id0'; + +const body: CreateLoyaltyPromotionRequest = { + loyaltyPromotion: { + name: 'Tuesday Happy Hour Promo', + incentive: { + type: 'POINTS_MULTIPLIER', + pointsMultiplierData: { + multiplier: '3.0', + }, + }, + availableTime: { + timePeriods: [ + 'BEGIN:VEVENT\nDTSTART:20220816T160000\nDURATION:PT2H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT' + ], + }, + triggerLimit: { + times: 1, + interval: 'DAY', + }, + minimumSpendAmountMoney: { + amount: BigInt(2000), + currency: 'USD', + }, + qualifyingCategoryIds: [ + 'XTQPYLR3IIU9C44VRCB3XD12' + ], + }, + idempotencyKey: 'ec78c477-b1c3-4899-a209-a4e71337c996', +}; + +try { + const { result, ...httpResponse } = await loyaltyApi.createLoyaltyPromotion( + programId, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Loyalty Promotion + +Retrieves a loyalty promotion. + +```ts +async retrieveLoyaltyPromotion( + promotionId: string, + programId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `promotionId` | `string` | Template, Required | The ID of the [loyalty promotion](entity:LoyaltyPromotion) to retrieve. | +| `programId` | `string` | Template, Required | The ID of the base [loyalty program](entity:LoyaltyProgram). To get the program ID,
call [RetrieveLoyaltyProgram](api-endpoint:Loyalty-RetrieveLoyaltyProgram) using the `main` keyword. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveLoyaltyPromotionResponse`](../../doc/models/retrieve-loyalty-promotion-response.md) + +## Example Usage + +```ts +const promotionId = 'promotion_id0'; + +const programId = 'program_id0'; + +try { + const { result, ...httpResponse } = await loyaltyApi.retrieveLoyaltyPromotion( + promotionId, + programId +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Cancel Loyalty Promotion + +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 + +```ts +async cancelLoyaltyPromotion( + promotionId: string, + programId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `promotionId` | `string` | Template, Required | The ID of the [loyalty promotion](entity:LoyaltyPromotion) to cancel. You can cancel a
promotion that has an `ACTIVE` or `SCHEDULED` status. | +| `programId` | `string` | Template, Required | The ID of the base [loyalty program](entity:LoyaltyProgram). | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CancelLoyaltyPromotionResponse`](../../doc/models/cancel-loyalty-promotion-response.md) + +## Example Usage + +```ts +const promotionId = 'promotion_id0'; + +const programId = 'program_id0'; + +try { + const { result, ...httpResponse } = await loyaltyApi.cancelLoyaltyPromotion( + promotionId, + programId +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Create Loyalty Reward + +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. + +```ts +async createLoyaltyReward( + body: CreateLoyaltyRewardRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`CreateLoyaltyRewardRequest`](../../doc/models/create-loyalty-reward-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CreateLoyaltyRewardResponse`](../../doc/models/create-loyalty-reward-response.md) + +## Example Usage + +```ts +const body: CreateLoyaltyRewardRequest = { + reward: { + loyaltyAccountId: '5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd', + rewardTierId: 'e1b39225-9da5-43d1-a5db-782cdd8ad94f', + orderId: 'RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY', + }, + idempotencyKey: '18c2e5ea-a620-4b1f-ad60-7b167285e451', +}; + +try { + const { result, ...httpResponse } = await loyaltyApi.createLoyaltyReward(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Search Loyalty Rewards + +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](../../doc/api/loyalty.md#retrieve-loyalty-reward) endpoint. + +Search results are sorted by `updated_at` in descending order. + +```ts +async searchLoyaltyRewards( + body: SearchLoyaltyRewardsRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`SearchLoyaltyRewardsRequest`](../../doc/models/search-loyalty-rewards-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`SearchLoyaltyRewardsResponse`](../../doc/models/search-loyalty-rewards-response.md) + +## Example Usage + +```ts +const body: SearchLoyaltyRewardsRequest = { + query: { + loyaltyAccountId: '5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd', + }, + limit: 10, +}; + +try { + const { result, ...httpResponse } = await loyaltyApi.searchLoyaltyRewards(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Delete Loyalty Reward + +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](../../doc/api/loyalty.md#create-loyalty-reward)), + it updates the order by removing the reward and related + discounts. + +You cannot delete a reward that has reached the terminal state (REDEEMED). + +```ts +async deleteLoyaltyReward( + rewardId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `rewardId` | `string` | Template, Required | The ID of the [loyalty reward](entity:LoyaltyReward) to delete. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`DeleteLoyaltyRewardResponse`](../../doc/models/delete-loyalty-reward-response.md) + +## Example Usage + +```ts +const rewardId = 'reward_id4'; + +try { + const { result, ...httpResponse } = await loyaltyApi.deleteLoyaltyReward(rewardId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Loyalty Reward + +Retrieves a loyalty reward. + +```ts +async retrieveLoyaltyReward( + rewardId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `rewardId` | `string` | Template, Required | The ID of the [loyalty reward](entity:LoyaltyReward) to retrieve. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveLoyaltyRewardResponse`](../../doc/models/retrieve-loyalty-reward-response.md) + +## Example Usage + +```ts +const rewardId = 'reward_id4'; + +try { + const { result, ...httpResponse } = await loyaltyApi.retrieveLoyaltyReward(rewardId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Redeem Loyalty Reward + +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. + +```ts +async redeemLoyaltyReward( + rewardId: string, + body: RedeemLoyaltyRewardRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `rewardId` | `string` | Template, Required | The ID of the [loyalty reward](entity:LoyaltyReward) to redeem. | +| `body` | [`RedeemLoyaltyRewardRequest`](../../doc/models/redeem-loyalty-reward-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RedeemLoyaltyRewardResponse`](../../doc/models/redeem-loyalty-reward-response.md) + +## Example Usage + +```ts +const rewardId = 'reward_id4'; + +const body: RedeemLoyaltyRewardRequest = { + idempotencyKey: '98adc7f7-6963-473b-b29c-f3c9cdd7d994', + locationId: 'P034NEENMD09F', +}; + +try { + const { result, ...httpResponse } = await loyaltyApi.redeemLoyaltyReward( + rewardId, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/merchant-custom-attributes.md b/legacy/doc/api/merchant-custom-attributes.md new file mode 100644 index 000000000..499597bf4 --- /dev/null +++ b/legacy/doc/api/merchant-custom-attributes.md @@ -0,0 +1,603 @@ +# Merchant Custom Attributes + +```ts +const merchantCustomAttributesApi = client.merchantCustomAttributesApi; +``` + +## Class Name + +`MerchantCustomAttributesApi` + +## Methods + +* [List Merchant Custom Attribute Definitions](../../doc/api/merchant-custom-attributes.md#list-merchant-custom-attribute-definitions) +* [Create Merchant Custom Attribute Definition](../../doc/api/merchant-custom-attributes.md#create-merchant-custom-attribute-definition) +* [Delete Merchant Custom Attribute Definition](../../doc/api/merchant-custom-attributes.md#delete-merchant-custom-attribute-definition) +* [Retrieve Merchant Custom Attribute Definition](../../doc/api/merchant-custom-attributes.md#retrieve-merchant-custom-attribute-definition) +* [Update Merchant Custom Attribute Definition](../../doc/api/merchant-custom-attributes.md#update-merchant-custom-attribute-definition) +* [Bulk Delete Merchant Custom Attributes](../../doc/api/merchant-custom-attributes.md#bulk-delete-merchant-custom-attributes) +* [Bulk Upsert Merchant Custom Attributes](../../doc/api/merchant-custom-attributes.md#bulk-upsert-merchant-custom-attributes) +* [List Merchant Custom Attributes](../../doc/api/merchant-custom-attributes.md#list-merchant-custom-attributes) +* [Delete Merchant Custom Attribute](../../doc/api/merchant-custom-attributes.md#delete-merchant-custom-attribute) +* [Retrieve Merchant Custom Attribute](../../doc/api/merchant-custom-attributes.md#retrieve-merchant-custom-attribute) +* [Upsert Merchant Custom Attribute](../../doc/api/merchant-custom-attributes.md#upsert-merchant-custom-attribute) + + +# List Merchant Custom Attribute Definitions + +Lists the merchant-related [custom attribute definitions](../../doc/models/custom-attribute-definition.md) 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`. + +```ts +async listMerchantCustomAttributeDefinitions( + visibilityFilter?: string, + limit?: number, + cursor?: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `visibilityFilter` | [`string \| undefined`](../../doc/models/visibility-filter.md) | Query, Optional | Filters the `CustomAttributeDefinition` results by their `visibility` values. | +| `limit` | `number \| undefined` | Query, Optional | 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` | `string \| undefined` | Query, Optional | 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). | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListMerchantCustomAttributeDefinitionsResponse`](../../doc/models/list-merchant-custom-attribute-definitions-response.md) + +## Example Usage + +```ts +try { + const { result, ...httpResponse } = await merchantCustomAttributesApi.listMerchantCustomAttributeDefinitions(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Create Merchant Custom Attribute Definition + +Creates a merchant-related [custom attribute definition](../../doc/models/custom-attribute-definition.md) 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](../../doc/api/merchant-custom-attributes.md#upsert-merchant-custom-attribute) or +[BulkUpsertMerchantCustomAttributes](../../doc/api/merchant-custom-attributes.md#bulk-upsert-merchant-custom-attributes) +to set the custom attribute for a merchant. + +```ts +async createMerchantCustomAttributeDefinition( + body: CreateMerchantCustomAttributeDefinitionRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`CreateMerchantCustomAttributeDefinitionRequest`](../../doc/models/create-merchant-custom-attribute-definition-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CreateMerchantCustomAttributeDefinitionResponse`](../../doc/models/create-merchant-custom-attribute-definition-response.md) + +## Example Usage + +```ts +const body: CreateMerchantCustomAttributeDefinitionRequest = { + customAttributeDefinition: { + key: 'alternative_seller_name', + name: 'Alternative Merchant Name', + description: 'This is the other name this merchant goes by.', + visibility: 'VISIBILITY_READ_ONLY', + }, +}; + +try { + const { result, ...httpResponse } = await merchantCustomAttributesApi.createMerchantCustomAttributeDefinition(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Delete Merchant Custom Attribute Definition + +Deletes a merchant-related [custom attribute definition](../../doc/models/custom-attribute-definition.md) 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. + +```ts +async deleteMerchantCustomAttributeDefinition( + key: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `key` | `string` | Template, Required | The key of the custom attribute definition to delete. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`DeleteMerchantCustomAttributeDefinitionResponse`](../../doc/models/delete-merchant-custom-attribute-definition-response.md) + +## Example Usage + +```ts +const key = 'key0'; + +try { + const { result, ...httpResponse } = await merchantCustomAttributesApi.deleteMerchantCustomAttributeDefinition(key); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Merchant Custom Attribute Definition + +Retrieves a merchant-related [custom attribute definition](../../doc/models/custom-attribute-definition.md) 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`. + +```ts +async retrieveMerchantCustomAttributeDefinition( + key: string, + version?: number, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `key` | `string` | Template, Required | The key of the custom attribute definition to retrieve. If the requesting application
is not the definition owner, you must use the qualified key. | +| `version` | `number \| undefined` | Query, Optional | 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. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveMerchantCustomAttributeDefinitionResponse`](../../doc/models/retrieve-merchant-custom-attribute-definition-response.md) + +## Example Usage + +```ts +const key = 'key0'; + +try { + const { result, ...httpResponse } = await merchantCustomAttributesApi.retrieveMerchantCustomAttributeDefinition(key); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Update Merchant Custom Attribute Definition + +Updates a merchant-related [custom attribute definition](../../doc/models/custom-attribute-definition.md) 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. + +```ts +async updateMerchantCustomAttributeDefinition( + key: string, + body: UpdateMerchantCustomAttributeDefinitionRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `key` | `string` | Template, Required | The key of the custom attribute definition to update. | +| `body` | [`UpdateMerchantCustomAttributeDefinitionRequest`](../../doc/models/update-merchant-custom-attribute-definition-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`UpdateMerchantCustomAttributeDefinitionResponse`](../../doc/models/update-merchant-custom-attribute-definition-response.md) + +## Example Usage + +```ts +const key = 'key0'; + +const body: UpdateMerchantCustomAttributeDefinitionRequest = { + customAttributeDefinition: { + description: 'Update the description as desired.', + visibility: 'VISIBILITY_READ_ONLY', + }, +}; + +try { + const { result, ...httpResponse } = await merchantCustomAttributesApi.updateMerchantCustomAttributeDefinition( + key, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Bulk Delete Merchant Custom Attributes + +Deletes [custom attributes](../../doc/models/custom-attribute.md) 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`. + +```ts +async bulkDeleteMerchantCustomAttributes( + body: BulkDeleteMerchantCustomAttributesRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BulkDeleteMerchantCustomAttributesRequest`](../../doc/models/bulk-delete-merchant-custom-attributes-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`BulkDeleteMerchantCustomAttributesResponse`](../../doc/models/bulk-delete-merchant-custom-attributes-response.md) + +## Example Usage + +```ts +const body: BulkDeleteMerchantCustomAttributesRequest = { + values: { + 'id1': { + }, + 'id2': { + } + }, +}; + +try { + const { result, ...httpResponse } = await merchantCustomAttributesApi.bulkDeleteMerchantCustomAttributes(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Bulk Upsert Merchant Custom Attributes + +Creates or updates [custom attributes](../../doc/models/custom-attribute.md) 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](../../doc/api/merchant-custom-attributes.md#create-merchant-custom-attribute-definition) 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`. + +```ts +async bulkUpsertMerchantCustomAttributes( + body: BulkUpsertMerchantCustomAttributesRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BulkUpsertMerchantCustomAttributesRequest`](../../doc/models/bulk-upsert-merchant-custom-attributes-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`BulkUpsertMerchantCustomAttributesResponse`](../../doc/models/bulk-upsert-merchant-custom-attributes-response.md) + +## Example Usage + +```ts +const body: BulkUpsertMerchantCustomAttributesRequest = { + values: { + 'key0': { + merchantId: 'merchant_id0', + customAttribute: { + }, + }, + 'key1': { + merchantId: 'merchant_id0', + customAttribute: { + }, + } + }, +}; + +try { + const { result, ...httpResponse } = await merchantCustomAttributesApi.bulkUpsertMerchantCustomAttributes(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# List Merchant Custom Attributes + +Lists the [custom attributes](../../doc/models/custom-attribute.md) 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`. + +```ts +async listMerchantCustomAttributes( + merchantId: string, + visibilityFilter?: string, + limit?: number, + cursor?: string, + withDefinitions?: boolean, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `merchantId` | `string` | Template, Required | The ID of the target [merchant](entity:Merchant). | +| `visibilityFilter` | [`string \| undefined`](../../doc/models/visibility-filter.md) | Query, Optional | Filters the `CustomAttributeDefinition` results by their `visibility` values. | +| `limit` | `number \| undefined` | Query, Optional | 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` | `string \| undefined` | Query, Optional | 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). | +| `withDefinitions` | `boolean \| undefined` | Query, Optional | 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`.
**Default**: `false` | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListMerchantCustomAttributesResponse`](../../doc/models/list-merchant-custom-attributes-response.md) + +## Example Usage + +```ts +const merchantId = 'merchant_id0'; + +const withDefinitions = false; + +try { + const { result, ...httpResponse } = await merchantCustomAttributesApi.listMerchantCustomAttributes( + merchantId, + undefined, + undefined, + undefined, + withDefinitions +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Delete Merchant Custom Attribute + +Deletes a [custom attribute](../../doc/models/custom-attribute.md) associated with a merchant. +To delete a custom attribute owned by another application, the `visibility` setting must be +`VISIBILITY_READ_WRITE_VALUES`. + +```ts +async deleteMerchantCustomAttribute( + merchantId: string, + key: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `merchantId` | `string` | Template, Required | The ID of the target [merchant](entity:Merchant). | +| `key` | `string` | Template, Required | 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. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`DeleteMerchantCustomAttributeResponse`](../../doc/models/delete-merchant-custom-attribute-response.md) + +## Example Usage + +```ts +const merchantId = 'merchant_id0'; + +const key = 'key0'; + +try { + const { result, ...httpResponse } = await merchantCustomAttributesApi.deleteMerchantCustomAttribute( + merchantId, + key +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Merchant Custom Attribute + +Retrieves a [custom attribute](../../doc/models/custom-attribute.md) 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`. + +```ts +async retrieveMerchantCustomAttribute( + merchantId: string, + key: string, + withDefinition?: boolean, + version?: number, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `merchantId` | `string` | Template, Required | The ID of the target [merchant](entity:Merchant). | +| `key` | `string` | Template, Required | 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. | +| `withDefinition` | `boolean \| undefined` | Query, Optional | 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`.
**Default**: `false` | +| `version` | `number \| undefined` | Query, Optional | 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. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveMerchantCustomAttributeResponse`](../../doc/models/retrieve-merchant-custom-attribute-response.md) + +## Example Usage + +```ts +const merchantId = 'merchant_id0'; + +const key = 'key0'; + +const withDefinition = false; + +try { + const { result, ...httpResponse } = await merchantCustomAttributesApi.retrieveMerchantCustomAttribute( + merchantId, + key, + withDefinition +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Upsert Merchant Custom Attribute + +Creates or updates a [custom attribute](../../doc/models/custom-attribute.md) 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](../../doc/api/merchant-custom-attributes.md#create-merchant-custom-attribute-definition) endpoint. +To create or update a custom attribute owned by another application, the `visibility` setting +must be `VISIBILITY_READ_WRITE_VALUES`. + +```ts +async upsertMerchantCustomAttribute( + merchantId: string, + key: string, + body: UpsertMerchantCustomAttributeRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `merchantId` | `string` | Template, Required | The ID of the target [merchant](entity:Merchant). | +| `key` | `string` | Template, Required | 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` | [`UpsertMerchantCustomAttributeRequest`](../../doc/models/upsert-merchant-custom-attribute-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`UpsertMerchantCustomAttributeResponse`](../../doc/models/upsert-merchant-custom-attribute-response.md) + +## Example Usage + +```ts +const merchantId = 'merchant_id0'; + +const key = 'key0'; + +const body: UpsertMerchantCustomAttributeRequest = { + customAttribute: { + }, +}; + +try { + const { result, ...httpResponse } = await merchantCustomAttributesApi.upsertMerchantCustomAttribute( + merchantId, + key, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/merchants.md b/legacy/doc/api/merchants.md new file mode 100644 index 000000000..e3d13e89d --- /dev/null +++ b/legacy/doc/api/merchants.md @@ -0,0 +1,102 @@ +# Merchants + +```ts +const merchantsApi = client.merchantsApi; +``` + +## Class Name + +`MerchantsApi` + +## Methods + +* [List Merchants](../../doc/api/merchants.md#list-merchants) +* [Retrieve Merchant](../../doc/api/merchants.md#retrieve-merchant) + + +# List Merchants + +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](../../doc/api/merchants.md#retrieve-merchant) +endpoint to retrieve the merchant information. + +```ts +async listMerchants( + cursor?: number, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `cursor` | `number \| undefined` | Query, Optional | The cursor generated by the previous response. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListMerchantsResponse`](../../doc/models/list-merchants-response.md) + +## Example Usage + +```ts +try { + const { result, ...httpResponse } = await merchantsApi.listMerchants(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Merchant + +Retrieves the `Merchant` object for the given `merchant_id`. + +```ts +async retrieveMerchant( + merchantId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `merchantId` | `string` | Template, Required | 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. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveMerchantResponse`](../../doc/models/retrieve-merchant-response.md) + +## Example Usage + +```ts +const merchantId = 'merchant_id0'; + +try { + const { result, ...httpResponse } = await merchantsApi.retrieveMerchant(merchantId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/mobile-authorization.md b/legacy/doc/api/mobile-authorization.md new file mode 100644 index 000000000..ad614acc7 --- /dev/null +++ b/legacy/doc/api/mobile-authorization.md @@ -0,0 +1,63 @@ +# Mobile Authorization + +```ts +const mobileAuthorizationApi = client.mobileAuthorizationApi; +``` + +## Class Name + +`MobileAuthorizationApi` + + +# Create Mobile Authorization Code + +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. + +__Important:__ 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). + +```ts +async createMobileAuthorizationCode( + body: CreateMobileAuthorizationCodeRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`CreateMobileAuthorizationCodeRequest`](../../doc/models/create-mobile-authorization-code-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CreateMobileAuthorizationCodeResponse`](../../doc/models/create-mobile-authorization-code-response.md) + +## Example Usage + +```ts +const body: CreateMobileAuthorizationCodeRequest = { + locationId: 'YOUR_LOCATION_ID', +}; + +try { + const { result, ...httpResponse } = await mobileAuthorizationApi.createMobileAuthorizationCode(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/o-auth.md b/legacy/doc/api/o-auth.md new file mode 100644 index 000000000..9de69302d --- /dev/null +++ b/legacy/doc/api/o-auth.md @@ -0,0 +1,193 @@ +# O Auth + +```ts +const oAuthApi = client.oAuthApi; +``` + +## Class Name + +`OAuthApi` + +## Methods + +* [Revoke Token](../../doc/api/o-auth.md#revoke-token) +* [Obtain Token](../../doc/api/o-auth.md#obtain-token) +* [Retrieve Token Status](../../doc/api/o-auth.md#retrieve-token-status) + + +# Revoke Token + +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. + +:information_source: **Note** This endpoint does not require authentication. + +```ts +async revokeToken( + body: RevokeTokenRequest, + authorization: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`RevokeTokenRequest`](../../doc/models/revoke-token-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `authorization` | `string` | Header, Required | Client APPLICATION_SECRET | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RevokeTokenResponse`](../../doc/models/revoke-token-response.md) + +## Example Usage + +```ts +const body: RevokeTokenRequest = { + clientId: 'CLIENT_ID', + accessToken: 'ACCESS_TOKEN', +}; + +const authorization = 'Client CLIENT_SECRET'; + +try { + const { result, ...httpResponse } = await oAuthApi.revokeToken( + body, + authorization +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Obtain Token + +Returns an OAuth access token and a refresh token unless the +`short_lived` parameter is set to `true`, in which case the endpoint +returns only an access token. + +The `grant_type` parameter specifies the type of OAuth request. If +`grant_type` is `authorization_code`, you must include the authorization +code you received when a seller granted you authorization. If `grant_type` +is `refresh_token`, you must provide a valid refresh token. If you're using +an old version of the Square APIs (prior to March 13, 2019), `grant_type` +can be `migration_token` and you must provide a valid migration token. + +You can use the `scopes` parameter to limit the set of permissions granted +to the access token and refresh token. You can use the `short_lived` parameter +to create an access token that expires in 24 hours. + +__Note:__ OAuth tokens should be encrypted and stored on a secure server. +Application clients should never interact directly with OAuth tokens. + +:information_source: **Note** This endpoint does not require authentication. + +```ts +async obtainToken( + body: ObtainTokenRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`ObtainTokenRequest`](../../doc/models/obtain-token-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ObtainTokenResponse`](../../doc/models/obtain-token-response.md) + +## Example Usage + +```ts +const body: ObtainTokenRequest = { + clientId: 'APPLICATION_ID', + grantType: 'authorization_code', + clientSecret: 'APPLICATION_SECRET', + code: 'CODE_FROM_AUTHORIZE', +}; + +try { + const { result, ...httpResponse } = await oAuthApi.obtainToken(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Token Status + +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). + +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: + +``` +Authorization: Bearer ACCESS_TOKEN +``` + +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. + +```ts +async retrieveTokenStatus( + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveTokenStatusResponse`](../../doc/models/retrieve-token-status-response.md) + +## Example Usage + +```ts +try { + const { result, ...httpResponse } = await oAuthApi.retrieveTokenStatus(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/order-custom-attributes.md b/legacy/doc/api/order-custom-attributes.md new file mode 100644 index 000000000..5bdfaf4af --- /dev/null +++ b/legacy/doc/api/order-custom-attributes.md @@ -0,0 +1,634 @@ +# Order Custom Attributes + +```ts +const orderCustomAttributesApi = client.orderCustomAttributesApi; +``` + +## Class Name + +`OrderCustomAttributesApi` + +## Methods + +* [List Order Custom Attribute Definitions](../../doc/api/order-custom-attributes.md#list-order-custom-attribute-definitions) +* [Create Order Custom Attribute Definition](../../doc/api/order-custom-attributes.md#create-order-custom-attribute-definition) +* [Delete Order Custom Attribute Definition](../../doc/api/order-custom-attributes.md#delete-order-custom-attribute-definition) +* [Retrieve Order Custom Attribute Definition](../../doc/api/order-custom-attributes.md#retrieve-order-custom-attribute-definition) +* [Update Order Custom Attribute Definition](../../doc/api/order-custom-attributes.md#update-order-custom-attribute-definition) +* [Bulk Delete Order Custom Attributes](../../doc/api/order-custom-attributes.md#bulk-delete-order-custom-attributes) +* [Bulk Upsert Order Custom Attributes](../../doc/api/order-custom-attributes.md#bulk-upsert-order-custom-attributes) +* [List Order Custom Attributes](../../doc/api/order-custom-attributes.md#list-order-custom-attributes) +* [Delete Order Custom Attribute](../../doc/api/order-custom-attributes.md#delete-order-custom-attribute) +* [Retrieve Order Custom Attribute](../../doc/api/order-custom-attributes.md#retrieve-order-custom-attribute) +* [Upsert Order Custom Attribute](../../doc/api/order-custom-attributes.md#upsert-order-custom-attribute) + + +# List Order Custom Attribute Definitions + +Lists the order-related [custom attribute definitions](../../doc/models/custom-attribute-definition.md) 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`. + +```ts +async listOrderCustomAttributeDefinitions( + visibilityFilter?: string, + cursor?: string, + limit?: number, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `visibilityFilter` | [`string \| undefined`](../../doc/models/visibility-filter.md) | Query, Optional | Requests that all of the custom attributes be returned, or only those that are read-only or read-write. | +| `cursor` | `string \| undefined` | Query, Optional | 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` | `number \| undefined` | Query, Optional | 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). | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListOrderCustomAttributeDefinitionsResponse`](../../doc/models/list-order-custom-attribute-definitions-response.md) + +## Example Usage + +```ts +try { + const { result, ...httpResponse } = await orderCustomAttributesApi.listOrderCustomAttributeDefinitions(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Create Order Custom Attribute Definition + +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. + +```ts +async createOrderCustomAttributeDefinition( + body: CreateOrderCustomAttributeDefinitionRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`CreateOrderCustomAttributeDefinitionRequest`](../../doc/models/create-order-custom-attribute-definition-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CreateOrderCustomAttributeDefinitionResponse`](../../doc/models/create-order-custom-attribute-definition-response.md) + +## Example Usage + +```ts +const body: CreateOrderCustomAttributeDefinitionRequest = { + customAttributeDefinition: { + key: 'cover-count', + name: 'Cover count', + description: 'The number of people seated at a table', + visibility: 'VISIBILITY_READ_WRITE_VALUES', + }, + idempotencyKey: 'IDEMPOTENCY_KEY', +}; + +try { + const { result, ...httpResponse } = await orderCustomAttributesApi.createOrderCustomAttributeDefinition(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Delete Order Custom Attribute Definition + +Deletes an order-related [custom attribute definition](../../doc/models/custom-attribute-definition.md) from a Square seller account. + +Only the definition owner can delete a custom attribute definition. + +```ts +async deleteOrderCustomAttributeDefinition( + key: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `key` | `string` | Template, Required | The key of the custom attribute definition to delete. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`DeleteOrderCustomAttributeDefinitionResponse`](../../doc/models/delete-order-custom-attribute-definition-response.md) + +## Example Usage + +```ts +const key = 'key0'; + +try { + const { result, ...httpResponse } = await orderCustomAttributesApi.deleteOrderCustomAttributeDefinition(key); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Order Custom Attribute Definition + +Retrieves an order-related [custom attribute definition](../../doc/models/custom-attribute-definition.md) 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`. + +```ts +async retrieveOrderCustomAttributeDefinition( + key: string, + version?: number, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `key` | `string` | Template, Required | The key of the custom attribute definition to retrieve. | +| `version` | `number \| undefined` | Query, Optional | 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. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveOrderCustomAttributeDefinitionResponse`](../../doc/models/retrieve-order-custom-attribute-definition-response.md) + +## Example Usage + +```ts +const key = 'key0'; + +try { + const { result, ...httpResponse } = await orderCustomAttributesApi.retrieveOrderCustomAttributeDefinition(key); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Update Order Custom Attribute Definition + +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`. + +```ts +async updateOrderCustomAttributeDefinition( + key: string, + body: UpdateOrderCustomAttributeDefinitionRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `key` | `string` | Template, Required | The key of the custom attribute definition to update. | +| `body` | [`UpdateOrderCustomAttributeDefinitionRequest`](../../doc/models/update-order-custom-attribute-definition-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`UpdateOrderCustomAttributeDefinitionResponse`](../../doc/models/update-order-custom-attribute-definition-response.md) + +## Example Usage + +```ts +const key = 'key0'; + +const body: UpdateOrderCustomAttributeDefinitionRequest = { + customAttributeDefinition: { + key: 'cover-count', + visibility: 'VISIBILITY_READ_ONLY', + version: 1, + }, + idempotencyKey: 'IDEMPOTENCY_KEY', +}; + +try { + const { result, ...httpResponse } = await orderCustomAttributesApi.updateOrderCustomAttributeDefinition( + key, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Bulk Delete Order Custom Attributes + +Deletes order [custom attributes](../../doc/models/custom-attribute.md) 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](../../doc/api/order-custom-attributes.md#create-order-custom-attribute-definition) 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`. + +```ts +async bulkDeleteOrderCustomAttributes( + body: BulkDeleteOrderCustomAttributesRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BulkDeleteOrderCustomAttributesRequest`](../../doc/models/bulk-delete-order-custom-attributes-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`BulkDeleteOrderCustomAttributesResponse`](../../doc/models/bulk-delete-order-custom-attributes-response.md) + +## Example Usage + +```ts +const body: BulkDeleteOrderCustomAttributesRequest = { + values: { + 'cover-count': { + orderId: '7BbXGEIWNldxAzrtGf9GPVZTwZ4F', + }, + 'table-number': { + orderId: '7BbXGEIWNldxAzrtGf9GPVZTwZ4F', + } + }, +}; + +try { + const { result, ...httpResponse } = await orderCustomAttributesApi.bulkDeleteOrderCustomAttributes(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Bulk Upsert Order Custom Attributes + +Creates or updates order [custom attributes](../../doc/models/custom-attribute.md) 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](../../doc/api/order-custom-attributes.md#create-order-custom-attribute-definition) 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`. + +```ts +async bulkUpsertOrderCustomAttributes( + body: BulkUpsertOrderCustomAttributesRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BulkUpsertOrderCustomAttributesRequest`](../../doc/models/bulk-upsert-order-custom-attributes-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`BulkUpsertOrderCustomAttributesResponse`](../../doc/models/bulk-upsert-order-custom-attributes-response.md) + +## Example Usage + +```ts +const body: BulkUpsertOrderCustomAttributesRequest = { + values: { + 'key0': { + customAttribute: { + }, + orderId: 'order_id4', + }, + 'key1': { + customAttribute: { + }, + orderId: 'order_id4', + } + }, +}; + +try { + const { result, ...httpResponse } = await orderCustomAttributesApi.bulkUpsertOrderCustomAttributes(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# List Order Custom Attributes + +Lists the [custom attributes](../../doc/models/custom-attribute.md) 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`. + +```ts +async listOrderCustomAttributes( + orderId: string, + visibilityFilter?: string, + cursor?: string, + limit?: number, + withDefinitions?: boolean, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `orderId` | `string` | Template, Required | The ID of the target [order](entity:Order). | +| `visibilityFilter` | [`string \| undefined`](../../doc/models/visibility-filter.md) | Query, Optional | Requests that all of the custom attributes be returned, or only those that are read-only or read-write. | +| `cursor` | `string \| undefined` | Query, Optional | 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` | `number \| undefined` | Query, Optional | 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). | +| `withDefinitions` | `boolean \| undefined` | Query, Optional | 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`.
**Default**: `false` | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListOrderCustomAttributesResponse`](../../doc/models/list-order-custom-attributes-response.md) + +## Example Usage + +```ts +const orderId = 'order_id6'; + +const withDefinitions = false; + +try { + const { result, ...httpResponse } = await orderCustomAttributesApi.listOrderCustomAttributes( + orderId, + undefined, + undefined, + undefined, + withDefinitions +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Delete Order Custom Attribute + +Deletes a [custom attribute](../../doc/models/custom-attribute.md) 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`. + +```ts +async deleteOrderCustomAttribute( + orderId: string, + customAttributeKey: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `orderId` | `string` | Template, Required | The ID of the target [order](entity:Order). | +| `customAttributeKey` | `string` | Template, Required | The key of the custom attribute to delete. This key must match the key of an
existing custom attribute definition. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`DeleteOrderCustomAttributeResponse`](../../doc/models/delete-order-custom-attribute-response.md) + +## Example Usage + +```ts +const orderId = 'order_id6'; + +const customAttributeKey = 'custom_attribute_key2'; + +try { + const { result, ...httpResponse } = await orderCustomAttributesApi.deleteOrderCustomAttribute( + orderId, + customAttributeKey +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Order Custom Attribute + +Retrieves a [custom attribute](../../doc/models/custom-attribute.md) 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`. + +```ts +async retrieveOrderCustomAttribute( + orderId: string, + customAttributeKey: string, + version?: number, + withDefinition?: boolean, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `orderId` | `string` | Template, Required | The ID of the target [order](entity:Order). | +| `customAttributeKey` | `string` | Template, Required | The key of the custom attribute to retrieve. This key must match the key of an
existing custom attribute definition. | +| `version` | `number \| undefined` | Query, Optional | 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. | +| `withDefinition` | `boolean \| undefined` | Query, Optional | 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`.
**Default**: `false` | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveOrderCustomAttributeResponse`](../../doc/models/retrieve-order-custom-attribute-response.md) + +## Example Usage + +```ts +const orderId = 'order_id6'; + +const customAttributeKey = 'custom_attribute_key2'; + +const withDefinition = false; + +try { + const { result, ...httpResponse } = await orderCustomAttributesApi.retrieveOrderCustomAttribute( + orderId, + customAttributeKey, + undefined, + withDefinition +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Upsert Order Custom Attribute + +Creates or updates a [custom attribute](../../doc/models/custom-attribute.md) 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](../../doc/api/order-custom-attributes.md#create-order-custom-attribute-definition) 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`. + +```ts +async upsertOrderCustomAttribute( + orderId: string, + customAttributeKey: string, + body: UpsertOrderCustomAttributeRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `orderId` | `string` | Template, Required | The ID of the target [order](entity:Order). | +| `customAttributeKey` | `string` | Template, Required | The key of the custom attribute to create or update. This key must match the key
of an existing custom attribute definition. | +| `body` | [`UpsertOrderCustomAttributeRequest`](../../doc/models/upsert-order-custom-attribute-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`UpsertOrderCustomAttributeResponse`](../../doc/models/upsert-order-custom-attribute-response.md) + +## Example Usage + +```ts +const orderId = 'order_id6'; + +const customAttributeKey = 'custom_attribute_key2'; + +const body: UpsertOrderCustomAttributeRequest = { + customAttribute: { + }, +}; + +try { + const { result, ...httpResponse } = await orderCustomAttributesApi.upsertOrderCustomAttribute( + orderId, + customAttributeKey, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/orders.md b/legacy/doc/api/orders.md new file mode 100644 index 000000000..8e1bc1bc7 --- /dev/null +++ b/legacy/doc/api/orders.md @@ -0,0 +1,539 @@ +# Orders + +```ts +const ordersApi = client.ordersApi; +``` + +## Class Name + +`OrdersApi` + +## Methods + +* [Create Order](../../doc/api/orders.md#create-order) +* [Batch Retrieve Orders](../../doc/api/orders.md#batch-retrieve-orders) +* [Calculate Order](../../doc/api/orders.md#calculate-order) +* [Clone Order](../../doc/api/orders.md#clone-order) +* [Search Orders](../../doc/api/orders.md#search-orders) +* [Retrieve Order](../../doc/api/orders.md#retrieve-order) +* [Update Order](../../doc/api/orders.md#update-order) +* [Pay Order](../../doc/api/orders.md#pay-order) + + +# Create Order + +Creates a new [order](../../doc/models/order.md) 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](../../doc/api/orders.md#update-order) endpoint. + +```ts +async createOrder( + body: CreateOrderRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`CreateOrderRequest`](../../doc/models/create-order-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CreateOrderResponse`](../../doc/models/create-order-response.md) + +## Example Usage + +```ts +const body: CreateOrderRequest = { + order: { + locationId: '057P5VYJ4A5X1', + referenceId: 'my-order-001', + lineItems: [ + { + quantity: '1', + name: 'New York Strip Steak', + basePriceMoney: { + amount: BigInt(1599), + currency: 'USD', + }, + }, + { + quantity: '2', + catalogObjectId: 'BEMYCSMIJL46OCDV4KYIKXIB', + modifiers: [ + { + catalogObjectId: 'CHQX7Y4KY6N5KINJKZCFURPZ', + } + ], + appliedDiscounts: [ + { + discountUid: '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', + catalogObjectId: 'DB7L55ZH2BGWI4H23ULIWOQ7', + scope: 'ORDER', + }, + { + uid: 'one-dollar-off', + name: 'Sale - $1.00 off', + amountMoney: { + amount: BigInt(100), + currency: 'USD', + }, + scope: 'LINE_ITEM', + } + ], + }, + idempotencyKey: '8193148c-9586-11e6-99f9-28cfe92138cf', +}; + +try { + const { result, ...httpResponse } = await ordersApi.createOrder(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Batch Retrieve Orders + +Retrieves a set of [orders](../../doc/models/order.md) by their IDs. + +If a given order ID does not exist, the ID is ignored instead of generating an error. + +```ts +async batchRetrieveOrders( + body: BatchRetrieveOrdersRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BatchRetrieveOrdersRequest`](../../doc/models/batch-retrieve-orders-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`BatchRetrieveOrdersResponse`](../../doc/models/batch-retrieve-orders-response.md) + +## Example Usage + +```ts +const body: BatchRetrieveOrdersRequest = { + orderIds: [ + 'CAISEM82RcpmcFBM0TfOyiHV3es', + 'CAISENgvlJ6jLWAzERDzjyHVybY' + ], + locationId: '057P5VYJ4A5X1', +}; + +try { + const { result, ...httpResponse } = await ordersApi.batchRetrieveOrders(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Calculate Order + +Enables applications to preview order pricing without creating an order. + +```ts +async calculateOrder( + body: CalculateOrderRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`CalculateOrderRequest`](../../doc/models/calculate-order-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CalculateOrderResponse`](../../doc/models/calculate-order-response.md) + +## Example Usage + +```ts +const body: CalculateOrderRequest = { + order: { + locationId: 'D7AVYMEAPJ3A3', + lineItems: [ + { + quantity: '1', + name: 'Item 1', + basePriceMoney: { + amount: BigInt(500), + currency: 'USD', + }, + }, + { + quantity: '2', + name: 'Item 2', + basePriceMoney: { + amount: BigInt(300), + currency: 'USD', + }, + } + ], + discounts: [ + { + name: '50% Off', + percentage: '50', + scope: 'ORDER', + } + ], + }, +}; + +try { + const { result, ...httpResponse } = await ordersApi.calculateOrder(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Clone Order + +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. + +```ts +async cloneOrder( + body: CloneOrderRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`CloneOrderRequest`](../../doc/models/clone-order-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CloneOrderResponse`](../../doc/models/clone-order-response.md) + +## Example Usage + +```ts +const body: CloneOrderRequest = { + orderId: 'ZAISEM52YcpmcWAzERDOyiWS123', + version: 3, + idempotencyKey: 'UNIQUE_STRING', +}; + +try { + const { result, ...httpResponse } = await ordersApi.cloneOrder(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Search Orders + +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](../../doc/models/search-orders-query.md) 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](../../doc/models/order-entry.md) 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. + +```ts +async searchOrders( + body: SearchOrdersRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`SearchOrdersRequest`](../../doc/models/search-orders-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`SearchOrdersResponse`](../../doc/models/search-orders-response.md) + +## Example Usage + +```ts +const body: SearchOrdersRequest = { + locationIds: [ + '057P5VYJ4A5X1', + '18YC4JDH91E1H' + ], + query: { + filter: { + stateFilter: { + states: [ + 'COMPLETED' + ], + }, + dateTimeFilter: { + closedAt: { + startAt: '2018-03-03T20:00:00+00:00', + endAt: '2019-03-04T21:54:45+00:00', + }, + }, + }, + sort: { + sortField: 'CLOSED_AT', + sortOrder: 'DESC', + }, + }, + limit: 3, + returnEntries: true, +}; + +try { + const { result, ...httpResponse } = await ordersApi.searchOrders(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Order + +Retrieves an [Order](../../doc/models/order.md) by ID. + +```ts +async retrieveOrder( + orderId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `orderId` | `string` | Template, Required | The ID of the order to retrieve. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveOrderResponse`](../../doc/models/retrieve-order-response.md) + +## Example Usage + +```ts +const orderId = 'order_id6'; + +try { + const { result, ...httpResponse } = await ordersApi.retrieveOrder(orderId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Update Order + +Updates an open [order](../../doc/models/order.md) 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). + +```ts +async updateOrder( + orderId: string, + body: UpdateOrderRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `orderId` | `string` | Template, Required | The ID of the order to update. | +| `body` | [`UpdateOrderRequest`](../../doc/models/update-order-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`UpdateOrderResponse`](../../doc/models/update-order-response.md) + +## Example Usage + +```ts +const orderId = 'order_id6'; + +const body: UpdateOrderRequest = { +}; + +try { + const { result, ...httpResponse } = await ordersApi.updateOrder( + orderId, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Pay Order + +Pay for an [order](../../doc/models/order.md) using one or more approved [payments](../../doc/models/payment.md) +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](../../doc/api/payments.md#create-payment). + 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. + +```ts +async payOrder( + orderId: string, + body: PayOrderRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `orderId` | `string` | Template, Required | The ID of the order being paid. | +| `body` | [`PayOrderRequest`](../../doc/models/pay-order-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`PayOrderResponse`](../../doc/models/pay-order-response.md) + +## Example Usage + +```ts +const orderId = 'order_id6'; + +const body: PayOrderRequest = { + idempotencyKey: 'c043a359-7ad9-4136-82a9-c3f1d66dcbff', + paymentIds: [ + 'EnZdNAlWCmfh6Mt5FMNST1o7taB', + '0LRiVlbXVwe8ozu4KbZxd12mvaB' + ], +}; + +try { + const { result, ...httpResponse } = await ordersApi.payOrder( + orderId, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/payments.md b/legacy/doc/api/payments.md new file mode 100644 index 000000000..2371fce02 --- /dev/null +++ b/legacy/doc/api/payments.md @@ -0,0 +1,412 @@ +# Payments + +```ts +const paymentsApi = client.paymentsApi; +``` + +## Class Name + +`PaymentsApi` + +## Methods + +* [List Payments](../../doc/api/payments.md#list-payments) +* [Create Payment](../../doc/api/payments.md#create-payment) +* [Cancel Payment by Idempotency Key](../../doc/api/payments.md#cancel-payment-by-idempotency-key) +* [Get Payment](../../doc/api/payments.md#get-payment) +* [Update Payment](../../doc/api/payments.md#update-payment) +* [Cancel Payment](../../doc/api/payments.md#cancel-payment) +* [Complete Payment](../../doc/api/payments.md#complete-payment) + + +# List Payments + +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. + +```ts +async listPayments( + beginTime?: string, + endTime?: string, + sortOrder?: string, + cursor?: string, + locationId?: string, + total?: bigint, + last4?: string, + cardBrand?: string, + limit?: number, + isOfflinePayment?: boolean, + offlineBeginTime?: string, + offlineEndTime?: string, + updatedAtBeginTime?: string, + updatedAtEndTime?: string, + sortField?: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `beginTime` | `string \| undefined` | Query, Optional | 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. | +| `endTime` | `string \| undefined` | Query, Optional | 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. | +| `sortOrder` | `string \| undefined` | Query, Optional | The order in which results are listed by `ListPaymentsRequest.sort_field`:

- `ASC` - Oldest to newest.
- `DESC` - Newest to oldest (default). | +| `cursor` | `string \| undefined` | Query, Optional | 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). | +| `locationId` | `string \| undefined` | Query, Optional | Limit results to the location supplied. By default, results are returned
for the default (main) location associated with the seller. | +| `total` | `bigint \| undefined` | Query, Optional | The exact amount in the `total_money` for a payment. | +| `last4` | `string \| undefined` | Query, Optional | The last four digits of a payment card. | +| `cardBrand` | `string \| undefined` | Query, Optional | The brand of the payment card (for example, VISA). | +| `limit` | `number \| undefined` | Query, Optional | 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` | +| `isOfflinePayment` | `boolean \| undefined` | Query, Optional | Whether the payment was taken offline or not.
**Default**: `false` | +| `offlineBeginTime` | `string \| undefined` | Query, Optional | 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. | +| `offlineEndTime` | `string \| undefined` | Query, Optional | 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. | +| `updatedAtBeginTime` | `string \| undefined` | Query, Optional | 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. | +| `updatedAtEndTime` | `string \| undefined` | Query, Optional | 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. | +| `sortField` | [`string \| undefined`](../../doc/models/payment-sort-field.md) | Query, Optional | The field used to sort results by. The default is `CREATED_AT`. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListPaymentsResponse`](../../doc/models/list-payments-response.md) + +## Example Usage + +```ts +const isOfflinePayment = false; + +try { + const { result, ...httpResponse } = await paymentsApi.listPayments( + undefined, + undefined, + undefined, + undefined, + undefined, + undefined, + undefined, + undefined, + undefined, + isOfflinePayment +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Create Payment + +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. + +```ts +async createPayment( + body: CreatePaymentRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`CreatePaymentRequest`](../../doc/models/create-payment-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CreatePaymentResponse`](../../doc/models/create-payment-response.md) + +## Example Usage + +```ts +const body: CreatePaymentRequest = { + sourceId: 'ccof:GaJGNaZa8x4OgDJn4GB', + idempotencyKey: '7b0f3ec5-086a-4871-8f13-3c81b3875218', + amountMoney: { + amount: BigInt(1000), + currency: 'USD', + }, + appFeeMoney: { + amount: BigInt(10), + currency: 'USD', + }, + autocomplete: true, + customerId: 'W92WH6P11H4Z77CTET0RNTGFW8', + locationId: 'L88917AVBK2S5', + referenceId: '123456', + note: 'Brief description', +}; + +try { + const { result, ...httpResponse } = await paymentsApi.createPayment(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Cancel Payment by Idempotency Key + +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. + +```ts +async cancelPaymentByIdempotencyKey( + body: CancelPaymentByIdempotencyKeyRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`CancelPaymentByIdempotencyKeyRequest`](../../doc/models/cancel-payment-by-idempotency-key-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CancelPaymentByIdempotencyKeyResponse`](../../doc/models/cancel-payment-by-idempotency-key-response.md) + +## Example Usage + +```ts +const body: CancelPaymentByIdempotencyKeyRequest = { + idempotencyKey: 'a7e36d40-d24b-11e8-b568-0800200c9a66', +}; + +try { + const { result, ...httpResponse } = await paymentsApi.cancelPaymentByIdempotencyKey(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Get Payment + +Retrieves details for a specific payment. + +```ts +async getPayment( + paymentId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `paymentId` | `string` | Template, Required | A unique ID for the desired payment. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`GetPaymentResponse`](../../doc/models/get-payment-response.md) + +## Example Usage + +```ts +const paymentId = 'payment_id0'; + +try { + const { result, ...httpResponse } = await paymentsApi.getPayment(paymentId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Update Payment + +Updates a payment with the APPROVED status. +You can update the `amount_money` and `tip_money` using this endpoint. + +```ts +async updatePayment( + paymentId: string, + body: UpdatePaymentRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `paymentId` | `string` | Template, Required | The ID of the payment to update. | +| `body` | [`UpdatePaymentRequest`](../../doc/models/update-payment-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`UpdatePaymentResponse`](../../doc/models/update-payment-response.md) + +## Example Usage + +```ts +const paymentId = 'payment_id0'; + +const body: UpdatePaymentRequest = { + idempotencyKey: '956f8b13-e4ec-45d6-85e8-d1d95ef0c5de', + payment: { + amountMoney: { + amount: BigInt(1000), + currency: 'USD', + }, + tipMoney: { + amount: BigInt(100), + currency: 'USD', + }, + versionToken: 'ODhwVQ35xwlzRuoZEwKXucfu7583sPTzK48c5zoGd0g6o', + }, +}; + +try { + const { result, ...httpResponse } = await paymentsApi.updatePayment( + paymentId, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Cancel Payment + +Cancels (voids) a payment. You can use this endpoint to cancel a payment with +the APPROVED `status`. + +```ts +async cancelPayment( + paymentId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `paymentId` | `string` | Template, Required | The ID of the payment to cancel. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CancelPaymentResponse`](../../doc/models/cancel-payment-response.md) + +## Example Usage + +```ts +const paymentId = 'payment_id0'; + +try { + const { result, ...httpResponse } = await paymentsApi.cancelPayment(paymentId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Complete Payment + +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`. + +```ts +async completePayment( + paymentId: string, + body: CompletePaymentRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `paymentId` | `string` | Template, Required | The unique ID identifying the payment to be completed. | +| `body` | [`CompletePaymentRequest`](../../doc/models/complete-payment-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CompletePaymentResponse`](../../doc/models/complete-payment-response.md) + +## Example Usage + +```ts +const paymentId = 'payment_id0'; + +const body: CompletePaymentRequest = { +}; + +try { + const { result, ...httpResponse } = await paymentsApi.completePayment( + paymentId, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/payouts.md b/legacy/doc/api/payouts.md new file mode 100644 index 000000000..dc33df5d1 --- /dev/null +++ b/legacy/doc/api/payouts.md @@ -0,0 +1,156 @@ +# Payouts + +```ts +const payoutsApi = client.payoutsApi; +``` + +## Class Name + +`PayoutsApi` + +## Methods + +* [List Payouts](../../doc/api/payouts.md#list-payouts) +* [Get Payout](../../doc/api/payouts.md#get-payout) +* [List Payout Entries](../../doc/api/payouts.md#list-payout-entries) + + +# List Payouts + +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. + +```ts +async listPayouts( + locationId?: string, + status?: string, + beginTime?: string, + endTime?: string, + sortOrder?: string, + cursor?: string, + limit?: number, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string \| undefined` | Query, Optional | 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` | [`string \| undefined`](../../doc/models/payout-status.md) | Query, Optional | If provided, only payouts with the given status are returned. | +| `beginTime` | `string \| undefined` | Query, Optional | The timestamp for the beginning of the payout creation time, in RFC 3339 format.
Inclusive. Default: The current time minus one year. | +| `endTime` | `string \| undefined` | Query, Optional | The timestamp for the end of the payout creation time, in RFC 3339 format.
Default: The current time. | +| `sortOrder` | [`string \| undefined`](../../doc/models/sort-order.md) | Query, Optional | The order in which payouts are listed. | +| `cursor` | `string \| undefined` | Query, Optional | 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` | `number \| undefined` | Query, Optional | 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` | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListPayoutsResponse`](../../doc/models/list-payouts-response.md) + +## Example Usage + +```ts +try { + const { result, ...httpResponse } = await payoutsApi.listPayouts(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Get Payout + +Retrieves details of a specific payout identified by a payout ID. +To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. + +```ts +async getPayout( + payoutId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `payoutId` | `string` | Template, Required | The ID of the payout to retrieve the information for. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`GetPayoutResponse`](../../doc/models/get-payout-response.md) + +## Example Usage + +```ts +const payoutId = 'payout_id6'; + +try { + const { result, ...httpResponse } = await payoutsApi.getPayout(payoutId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# List Payout Entries + +Retrieves a list of all payout entries for a specific payout. +To call this endpoint, set `PAYOUTS_READ` for the OAuth scope. + +```ts +async listPayoutEntries( + payoutId: string, + sortOrder?: string, + cursor?: string, + limit?: number, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `payoutId` | `string` | Template, Required | The ID of the payout to retrieve the information for. | +| `sortOrder` | [`string \| undefined`](../../doc/models/sort-order.md) | Query, Optional | The order in which payout entries are listed. | +| `cursor` | `string \| undefined` | Query, Optional | 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` | `number \| undefined` | Query, Optional | 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` | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListPayoutEntriesResponse`](../../doc/models/list-payout-entries-response.md) + +## Example Usage + +```ts +const payoutId = 'payout_id6'; + +try { + const { result, ...httpResponse } = await payoutsApi.listPayoutEntries(payoutId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/refunds.md b/legacy/doc/api/refunds.md new file mode 100644 index 000000000..6109deaec --- /dev/null +++ b/legacy/doc/api/refunds.md @@ -0,0 +1,168 @@ +# Refunds + +```ts +const refundsApi = client.refundsApi; +``` + +## Class Name + +`RefundsApi` + +## Methods + +* [List Payment Refunds](../../doc/api/refunds.md#list-payment-refunds) +* [Refund Payment](../../doc/api/refunds.md#refund-payment) +* [Get Payment Refund](../../doc/api/refunds.md#get-payment-refund) + + +# List Payment Refunds + +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. + +```ts +async listPaymentRefunds( + beginTime?: string, + endTime?: string, + sortOrder?: string, + cursor?: string, + locationId?: string, + status?: string, + sourceType?: string, + limit?: number, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `beginTime` | `string \| undefined` | Query, Optional | 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. | +| `endTime` | `string \| undefined` | Query, Optional | 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. | +| `sortOrder` | `string \| undefined` | Query, Optional | The order in which results are listed by `PaymentRefund.created_at`:

- `ASC` - Oldest to newest.
- `DESC` - Newest to oldest (default). | +| `cursor` | `string \| undefined` | Query, Optional | 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). | +| `locationId` | `string \| undefined` | Query, Optional | Limit results to the location supplied. By default, results are returned
for all locations associated with the seller. | +| `status` | `string \| undefined` | Query, Optional | 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. | +| `sourceType` | `string \| undefined` | Query, Optional | 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` | `number \| undefined` | Query, Optional | 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 | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListPaymentRefundsResponse`](../../doc/models/list-payment-refunds-response.md) + +## Example Usage + +```ts +try { + const { result, ...httpResponse } = await refundsApi.listPaymentRefunds(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Refund Payment + +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). + +```ts +async refundPayment( + body: RefundPaymentRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`RefundPaymentRequest`](../../doc/models/refund-payment-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RefundPaymentResponse`](../../doc/models/refund-payment-response.md) + +## Example Usage + +```ts +const body: RefundPaymentRequest = { + idempotencyKey: '9b7f2dcf-49da-4411-b23e-a2d6af21333a', + amountMoney: { + amount: BigInt(1000), + currency: 'USD', + }, + appFeeMoney: { + amount: BigInt(10), + currency: 'USD', + }, + paymentId: 'R2B3Z8WMVt3EAmzYWLZvz7Y69EbZY', + reason: 'Example', +}; + +try { + const { result, ...httpResponse } = await refundsApi.refundPayment(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Get Payment Refund + +Retrieves a specific refund using the `refund_id`. + +```ts +async getPaymentRefund( + refundId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `refundId` | `string` | Template, Required | The unique ID for the desired `PaymentRefund`. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`GetPaymentRefundResponse`](../../doc/models/get-payment-refund-response.md) + +## Example Usage + +```ts +const refundId = 'refund_id4'; + +try { + const { result, ...httpResponse } = await refundsApi.getPaymentRefund(refundId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/sites.md b/legacy/doc/api/sites.md new file mode 100644 index 000000000..f72f32349 --- /dev/null +++ b/legacy/doc/api/sites.md @@ -0,0 +1,48 @@ +# Sites + +```ts +const sitesApi = client.sitesApi; +``` + +## Class Name + +`SitesApi` + + +# List Sites + +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). + +```ts +async listSites( + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListSitesResponse`](../../doc/models/list-sites-response.md) + +## Example Usage + +```ts +try { + const { result, ...httpResponse } = await sitesApi.listSites(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/snippets.md b/legacy/doc/api/snippets.md new file mode 100644 index 000000000..a05b73db7 --- /dev/null +++ b/legacy/doc/api/snippets.md @@ -0,0 +1,160 @@ +# Snippets + +```ts +const snippetsApi = client.snippetsApi; +``` + +## Class Name + +`SnippetsApi` + +## Methods + +* [Delete Snippet](../../doc/api/snippets.md#delete-snippet) +* [Retrieve Snippet](../../doc/api/snippets.md#retrieve-snippet) +* [Upsert Snippet](../../doc/api/snippets.md#upsert-snippet) + + +# Delete Snippet + +Removes your snippet from a Square Online site. + +You can call [ListSites](../../doc/api/sites.md#list-sites) 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). + +```ts +async deleteSnippet( + siteId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `siteId` | `string` | Template, Required | The ID of the site that contains the snippet. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`DeleteSnippetResponse`](../../doc/models/delete-snippet-response.md) + +## Example Usage + +```ts +const siteId = 'site_id6'; + +try { + const { result, ...httpResponse } = await snippetsApi.deleteSnippet(siteId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Snippet + +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](../../doc/api/sites.md#list-sites) 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). + +```ts +async retrieveSnippet( + siteId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `siteId` | `string` | Template, Required | The ID of the site that contains the snippet. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveSnippetResponse`](../../doc/models/retrieve-snippet-response.md) + +## Example Usage + +```ts +const siteId = 'site_id6'; + +try { + const { result, ...httpResponse } = await snippetsApi.retrieveSnippet(siteId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Upsert Snippet + +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](../../doc/api/sites.md#list-sites) 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). + +```ts +async upsertSnippet( + siteId: string, + body: UpsertSnippetRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `siteId` | `string` | Template, Required | The ID of the site where you want to add or update the snippet. | +| `body` | [`UpsertSnippetRequest`](../../doc/models/upsert-snippet-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`UpsertSnippetResponse`](../../doc/models/upsert-snippet-response.md) + +## Example Usage + +```ts +const siteId = 'site_id6'; + +const body: UpsertSnippetRequest = { + snippet: { + content: '', + }, +}; + +try { + const { result, ...httpResponse } = await snippetsApi.upsertSnippet( + siteId, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/subscriptions.md b/legacy/doc/api/subscriptions.md new file mode 100644 index 000000000..85cca5654 --- /dev/null +++ b/legacy/doc/api/subscriptions.md @@ -0,0 +1,631 @@ +# Subscriptions + +```ts +const subscriptionsApi = client.subscriptionsApi; +``` + +## Class Name + +`SubscriptionsApi` + +## Methods + +* [Create Subscription](../../doc/api/subscriptions.md#create-subscription) +* [Bulk Swap Plan](../../doc/api/subscriptions.md#bulk-swap-plan) +* [Search Subscriptions](../../doc/api/subscriptions.md#search-subscriptions) +* [Retrieve Subscription](../../doc/api/subscriptions.md#retrieve-subscription) +* [Update Subscription](../../doc/api/subscriptions.md#update-subscription) +* [Delete Subscription Action](../../doc/api/subscriptions.md#delete-subscription-action) +* [Change Billing Anchor Date](../../doc/api/subscriptions.md#change-billing-anchor-date) +* [Cancel Subscription](../../doc/api/subscriptions.md#cancel-subscription) +* [List Subscription Events](../../doc/api/subscriptions.md#list-subscription-events) +* [Pause Subscription](../../doc/api/subscriptions.md#pause-subscription) +* [Resume Subscription](../../doc/api/subscriptions.md#resume-subscription) +* [Swap Plan](../../doc/api/subscriptions.md#swap-plan) + + +# Create Subscription + +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). + +```ts +async createSubscription( + body: CreateSubscriptionRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`CreateSubscriptionRequest`](../../doc/models/create-subscription-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CreateSubscriptionResponse`](../../doc/models/create-subscription-response.md) + +## Example Usage + +```ts +const body: CreateSubscriptionRequest = { + locationId: 'S8GWD5R9QB376', + customerId: 'CHFGVKYY8RSV93M5KCYTG4PN0G', + idempotencyKey: '8193148c-9586-11e6-99f9-28cfe92138cf', + planVariationId: '6JHXF3B2CW3YKHDV4XEM674H', + startDate: '2023-06-20', + cardId: 'ccof:qy5x8hHGYsgLrp4Q4GB', + timezone: 'America/Los_Angeles', + source: { + name: 'My Application', + }, + phases: [ + { + ordinal: BigInt(0), + orderTemplateId: 'U2NaowWxzXwpsZU697x7ZHOAnCNZY', + } + ], +}; + +try { + const { result, ...httpResponse } = await subscriptionsApi.createSubscription(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Bulk Swap Plan + +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). + +```ts +async bulkSwapPlan( + body: BulkSwapPlanRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BulkSwapPlanRequest`](../../doc/models/bulk-swap-plan-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`BulkSwapPlanResponse`](../../doc/models/bulk-swap-plan-response.md) + +## Example Usage + +```ts +const body: BulkSwapPlanRequest = { + newPlanVariationId: 'FQ7CDXXWSLUJRPM3GFJSJGZ7', + oldPlanVariationId: '6JHXF3B2CW3YKHDV4XEM674H', + locationId: 'S8GWD5R9QB376', +}; + +try { + const { result, ...httpResponse } = await subscriptionsApi.bulkSwapPlan(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Search Subscriptions + +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. + +```ts +async searchSubscriptions( + body: SearchSubscriptionsRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`SearchSubscriptionsRequest`](../../doc/models/search-subscriptions-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`SearchSubscriptionsResponse`](../../doc/models/search-subscriptions-response.md) + +## Example Usage + +```ts +const body: SearchSubscriptionsRequest = { + query: { + filter: { + customerIds: [ + 'CHFGVKYY8RSV93M5KCYTG4PN0G' + ], + locationIds: [ + 'S8GWD5R9QB376' + ], + sourceNames: [ + 'My App' + ], + }, + }, +}; + +try { + const { result, ...httpResponse } = await subscriptionsApi.searchSubscriptions(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Subscription + +Retrieves a specific subscription. + +```ts +async retrieveSubscription( + subscriptionId: string, + include?: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `string` | Template, Required | The ID of the subscription to retrieve. | +| `include` | `string \| undefined` | Query, Optional | 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. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveSubscriptionResponse`](../../doc/models/retrieve-subscription-response.md) + +## Example Usage + +```ts +const subscriptionId = 'subscription_id0'; + +try { + const { result, ...httpResponse } = await subscriptionsApi.retrieveSubscription(subscriptionId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Update Subscription + +Updates a subscription by modifying or clearing `subscription` field values. +To clear a field, set its value to `null`. + +```ts +async updateSubscription( + subscriptionId: string, + body: UpdateSubscriptionRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `string` | Template, Required | The ID of the subscription to update. | +| `body` | [`UpdateSubscriptionRequest`](../../doc/models/update-subscription-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`UpdateSubscriptionResponse`](../../doc/models/update-subscription-response.md) + +## Example Usage + +```ts +const subscriptionId = 'subscription_id0'; + +const body: UpdateSubscriptionRequest = { + subscription: { + canceledDate: 'canceled_date6', + cardId: '{NEW CARD ID}', + }, +}; + +try { + const { result, ...httpResponse } = await subscriptionsApi.updateSubscription( + subscriptionId, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Delete Subscription Action + +Deletes a scheduled action for a subscription. + +```ts +async deleteSubscriptionAction( + subscriptionId: string, + actionId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `string` | Template, Required | The ID of the subscription the targeted action is to act upon. | +| `actionId` | `string` | Template, Required | The ID of the targeted action to be deleted. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`DeleteSubscriptionActionResponse`](../../doc/models/delete-subscription-action-response.md) + +## Example Usage + +```ts +const subscriptionId = 'subscription_id0'; + +const actionId = 'action_id6'; + +try { + const { result, ...httpResponse } = await subscriptionsApi.deleteSubscriptionAction( + subscriptionId, + actionId +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Change Billing Anchor Date + +Changes the [billing anchor date](https://developer.squareup.com/docs/subscriptions-api/subscription-billing#billing-dates) +for a subscription. + +```ts +async changeBillingAnchorDate( + subscriptionId: string, + body: ChangeBillingAnchorDateRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `string` | Template, Required | The ID of the subscription to update the billing anchor date. | +| `body` | [`ChangeBillingAnchorDateRequest`](../../doc/models/change-billing-anchor-date-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ChangeBillingAnchorDateResponse`](../../doc/models/change-billing-anchor-date-response.md) + +## Example Usage + +```ts +const subscriptionId = 'subscription_id0'; + +const body: ChangeBillingAnchorDateRequest = { + monthlyBillingAnchorDate: 1, +}; + +try { + const { result, ...httpResponse } = await subscriptionsApi.changeBillingAnchorDate( + subscriptionId, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Cancel Subscription + +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. + +```ts +async cancelSubscription( + subscriptionId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `string` | Template, Required | The ID of the subscription to cancel. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CancelSubscriptionResponse`](../../doc/models/cancel-subscription-response.md) + +## Example Usage + +```ts +const subscriptionId = 'subscription_id0'; + +try { + const { result, ...httpResponse } = await subscriptionsApi.cancelSubscription(subscriptionId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# List Subscription Events + +Lists all [events](https://developer.squareup.com/docs/subscriptions-api/actions-events) for a specific subscription. + +```ts +async listSubscriptionEvents( + subscriptionId: string, + cursor?: string, + limit?: number, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `string` | Template, Required | The ID of the subscription to retrieve the events for. | +| `cursor` | `string \| undefined` | Query, Optional | 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` | `number \| undefined` | Query, Optional | The upper limit on the number of subscription events to return
in a paged response. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListSubscriptionEventsResponse`](../../doc/models/list-subscription-events-response.md) + +## Example Usage + +```ts +const subscriptionId = 'subscription_id0'; + +try { + const { result, ...httpResponse } = await subscriptionsApi.listSubscriptionEvents(subscriptionId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Pause Subscription + +Schedules a `PAUSE` action to pause an active subscription. + +```ts +async pauseSubscription( + subscriptionId: string, + body: PauseSubscriptionRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `string` | Template, Required | The ID of the subscription to pause. | +| `body` | [`PauseSubscriptionRequest`](../../doc/models/pause-subscription-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`PauseSubscriptionResponse`](../../doc/models/pause-subscription-response.md) + +## Example Usage + +```ts +const subscriptionId = 'subscription_id0'; + +const body: PauseSubscriptionRequest = { +}; + +try { + const { result, ...httpResponse } = await subscriptionsApi.pauseSubscription( + subscriptionId, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Resume Subscription + +Schedules a `RESUME` action to resume a paused or a deactivated subscription. + +```ts +async resumeSubscription( + subscriptionId: string, + body: ResumeSubscriptionRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `string` | Template, Required | The ID of the subscription to resume. | +| `body` | [`ResumeSubscriptionRequest`](../../doc/models/resume-subscription-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ResumeSubscriptionResponse`](../../doc/models/resume-subscription-response.md) + +## Example Usage + +```ts +const subscriptionId = 'subscription_id0'; + +const body: ResumeSubscriptionRequest = { +}; + +try { + const { result, ...httpResponse } = await subscriptionsApi.resumeSubscription( + subscriptionId, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Swap Plan + +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). + +```ts +async swapPlan( + subscriptionId: string, + body: SwapPlanRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `string` | Template, Required | The ID of the subscription to swap the subscription plan for. | +| `body` | [`SwapPlanRequest`](../../doc/models/swap-plan-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`SwapPlanResponse`](../../doc/models/swap-plan-response.md) + +## Example Usage + +```ts +const subscriptionId = 'subscription_id0'; + +const body: SwapPlanRequest = { + newPlanVariationId: 'FQ7CDXXWSLUJRPM3GFJSJGZ7', + phases: [ + { + ordinal: BigInt(0), + orderTemplateId: 'uhhnjH9osVv3shUADwaC0b3hNxQZY', + } + ], +}; + +try { + const { result, ...httpResponse } = await subscriptionsApi.swapPlan( + subscriptionId, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/team.md b/legacy/doc/api/team.md new file mode 100644 index 000000000..3e2df88e0 --- /dev/null +++ b/legacy/doc/api/team.md @@ -0,0 +1,721 @@ +# Team + +```ts +const teamApi = client.teamApi; +``` + +## Class Name + +`TeamApi` + +## Methods + +* [Create Team Member](../../doc/api/team.md#create-team-member) +* [Bulk Create Team Members](../../doc/api/team.md#bulk-create-team-members) +* [Bulk Update Team Members](../../doc/api/team.md#bulk-update-team-members) +* [List Jobs](../../doc/api/team.md#list-jobs) +* [Create Job](../../doc/api/team.md#create-job) +* [Retrieve Job](../../doc/api/team.md#retrieve-job) +* [Update Job](../../doc/api/team.md#update-job) +* [Search Team Members](../../doc/api/team.md#search-team-members) +* [Retrieve Team Member](../../doc/api/team.md#retrieve-team-member) +* [Update Team Member](../../doc/api/team.md#update-team-member) +* [Retrieve Wage Setting](../../doc/api/team.md#retrieve-wage-setting) +* [Update Wage Setting](../../doc/api/team.md#update-wage-setting) + + +# Create Team Member + +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). + +```ts +async createTeamMember( + body: CreateTeamMemberRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`CreateTeamMemberRequest`](../../doc/models/create-team-member-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CreateTeamMemberResponse`](../../doc/models/create-team-member-response.md) + +## Example Usage + +```ts +const body: CreateTeamMemberRequest = { + idempotencyKey: 'idempotency-key-0', + teamMember: { + referenceId: 'reference_id_1', + status: 'ACTIVE', + givenName: 'Joe', + familyName: 'Doe', + emailAddress: 'joe_doe@gmail.com', + phoneNumber: '+14159283333', + assignedLocations: { + assignmentType: 'EXPLICIT_LOCATIONS', + locationIds: [ + 'YSGH2WBKG94QZ', + 'GA2Y9HSJ8KRYT' + ], + }, + wageSetting: { + jobAssignments: [ + { + payType: 'SALARY', + annualRate: { + amount: BigInt(3000000), + currency: 'USD', + }, + weeklyHours: 40, + jobId: 'FjS8x95cqHiMenw4f1NAUH4P', + }, + { + payType: 'HOURLY', + hourlyRate: { + amount: BigInt(2000), + currency: 'USD', + }, + jobId: 'VDNpRv8da51NU8qZFC5zDWpF', + } + ], + isOvertimeExempt: true, + }, + }, +}; + +try { + const { result, ...httpResponse } = await teamApi.createTeamMember(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Bulk Create Team Members + +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). + +```ts +async bulkCreateTeamMembers( + body: BulkCreateTeamMembersRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BulkCreateTeamMembersRequest`](../../doc/models/bulk-create-team-members-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`BulkCreateTeamMembersResponse`](../../doc/models/bulk-create-team-members-response.md) + +## Example Usage + +```ts +const body: BulkCreateTeamMembersRequest = { + teamMembers: { + 'idempotency-key-1': { + teamMember: { + referenceId: 'reference_id_1', + givenName: 'Joe', + familyName: 'Doe', + emailAddress: 'joe_doe@gmail.com', + phoneNumber: '+14159283333', + assignedLocations: { + assignmentType: 'EXPLICIT_LOCATIONS', + locationIds: [ + 'YSGH2WBKG94QZ', + 'GA2Y9HSJ8KRYT' + ], + }, + }, + }, + 'idempotency-key-2': { + teamMember: { + referenceId: 'reference_id_2', + givenName: 'Jane', + familyName: 'Smith', + emailAddress: 'jane_smith@gmail.com', + phoneNumber: '+14159223334', + assignedLocations: { + assignmentType: 'ALL_CURRENT_AND_FUTURE_LOCATIONS', + }, + }, + } + }, +}; + +try { + const { result, ...httpResponse } = await teamApi.bulkCreateTeamMembers(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Bulk Update Team Members + +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). + +```ts +async bulkUpdateTeamMembers( + body: BulkUpdateTeamMembersRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BulkUpdateTeamMembersRequest`](../../doc/models/bulk-update-team-members-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`BulkUpdateTeamMembersResponse`](../../doc/models/bulk-update-team-members-response.md) + +## Example Usage + +```ts +const body: BulkUpdateTeamMembersRequest = { + teamMembers: { + 'AFMwA08kR-MIF-3Vs0OE': { + teamMember: { + referenceId: 'reference_id_2', + status: 'ACTIVE', + givenName: 'Jane', + familyName: 'Smith', + emailAddress: 'jane_smith@gmail.com', + phoneNumber: '+14159223334', + assignedLocations: { + assignmentType: 'ALL_CURRENT_AND_FUTURE_LOCATIONS', + }, + }, + }, + 'fpgteZNMaf0qOK-a4t6P': { + teamMember: { + referenceId: 'reference_id_1', + status: 'ACTIVE', + givenName: 'Joe', + familyName: 'Doe', + emailAddress: 'joe_doe@gmail.com', + phoneNumber: '+14159283333', + assignedLocations: { + assignmentType: 'EXPLICIT_LOCATIONS', + locationIds: [ + 'YSGH2WBKG94QZ', + 'GA2Y9HSJ8KRYT' + ], + }, + }, + } + }, +}; + +try { + const { result, ...httpResponse } = await teamApi.bulkUpdateTeamMembers(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# List Jobs + +Lists jobs in a seller account. Results are sorted by title in ascending order. + +```ts +async listJobs( + cursor?: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `cursor` | `string \| undefined` | Query, Optional | 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). | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListJobsResponse`](../../doc/models/list-jobs-response.md) + +## Example Usage + +```ts +try { + const { result, ...httpResponse } = await teamApi.listJobs(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Create Job + +Creates a job in a seller account. A job defines a title and tip eligibility. Note that +compensation is defined in a [job assignment](../../doc/models/job-assignment.md) in a team member's wage setting. + +```ts +async createJob( + body: CreateJobRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`CreateJobRequest`](../../doc/models/create-job-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CreateJobResponse`](../../doc/models/create-job-response.md) + +## Example Usage + +```ts +const body: CreateJobRequest = { + job: { + title: 'Cashier', + isTipEligible: true, + }, + idempotencyKey: 'idempotency-key-0', +}; + +try { + const { result, ...httpResponse } = await teamApi.createJob(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Job + +Retrieves a specified job. + +```ts +async retrieveJob( + jobId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `jobId` | `string` | Template, Required | The ID of the job to retrieve. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveJobResponse`](../../doc/models/retrieve-job-response.md) + +## Example Usage + +```ts +const jobId = 'job_id2'; + +try { + const { result, ...httpResponse } = await teamApi.retrieveJob(jobId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Update Job + +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. + +```ts +async updateJob( + jobId: string, + body: UpdateJobRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `jobId` | `string` | Template, Required | The ID of the job to update. | +| `body` | [`UpdateJobRequest`](../../doc/models/update-job-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`UpdateJobResponse`](../../doc/models/update-job-response.md) + +## Example Usage + +```ts +const jobId = 'job_id2'; + +const body: UpdateJobRequest = { + job: { + title: 'Cashier 1', + isTipEligible: true, + }, +}; + +try { + const { result, ...httpResponse } = await teamApi.updateJob( + jobId, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Search Team Members + +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. + +```ts +async searchTeamMembers( + body: SearchTeamMembersRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`SearchTeamMembersRequest`](../../doc/models/search-team-members-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`SearchTeamMembersResponse`](../../doc/models/search-team-members-response.md) + +## Example Usage + +```ts +const body: SearchTeamMembersRequest = { + query: { + filter: { + locationIds: [ + '0G5P3VGACMMQZ' + ], + status: 'ACTIVE', + }, + }, + limit: 10, +}; + +try { + const { result, ...httpResponse } = await teamApi.searchTeamMembers(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Team Member + +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). + +```ts +async retrieveTeamMember( + teamMemberId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `teamMemberId` | `string` | Template, Required | The ID of the team member to retrieve. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveTeamMemberResponse`](../../doc/models/retrieve-team-member-response.md) + +## Example Usage + +```ts +const teamMemberId = 'team_member_id0'; + +try { + const { result, ...httpResponse } = await teamApi.retrieveTeamMember(teamMemberId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Update Team Member + +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). + +```ts +async updateTeamMember( + teamMemberId: string, + body: UpdateTeamMemberRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `teamMemberId` | `string` | Template, Required | The ID of the team member to update. | +| `body` | [`UpdateTeamMemberRequest`](../../doc/models/update-team-member-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`UpdateTeamMemberResponse`](../../doc/models/update-team-member-response.md) + +## Example Usage + +```ts +const teamMemberId = 'team_member_id0'; + +const body: UpdateTeamMemberRequest = { + teamMember: { + referenceId: 'reference_id_1', + status: 'ACTIVE', + givenName: 'Joe', + familyName: 'Doe', + emailAddress: 'joe_doe@gmail.com', + phoneNumber: '+14159283333', + assignedLocations: { + assignmentType: 'EXPLICIT_LOCATIONS', + locationIds: [ + 'YSGH2WBKG94QZ', + 'GA2Y9HSJ8KRYT' + ], + }, + }, +}; + +try { + const { result, ...httpResponse } = await teamApi.updateTeamMember( + teamMemberId, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Wage Setting + +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](../../doc/api/team.md#retrieve-team-member) or [SearchTeamMembers](../../doc/api/team.md#search-team-members) +to get this information directly from the `TeamMember.wage_setting` field. + +```ts +async retrieveWageSetting( + teamMemberId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `teamMemberId` | `string` | Template, Required | The ID of the team member for which to retrieve the wage setting. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveWageSettingResponse`](../../doc/models/retrieve-wage-setting-response.md) + +## Example Usage + +```ts +const teamMemberId = 'team_member_id0'; + +try { + const { result, ...httpResponse } = await teamApi.retrieveWageSetting(teamMemberId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Update Wage Setting + +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](../../doc/api/team.md#create-team-member) or [UpdateTeamMember](../../doc/api/team.md#update-team-member) +to manage the `TeamMember.wage_setting` field directly. + +```ts +async updateWageSetting( + teamMemberId: string, + body: UpdateWageSettingRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `teamMemberId` | `string` | Template, Required | The ID of the team member for which to update the `WageSetting` object. | +| `body` | [`UpdateWageSettingRequest`](../../doc/models/update-wage-setting-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`UpdateWageSettingResponse`](../../doc/models/update-wage-setting-response.md) + +## Example Usage + +```ts +const teamMemberId = 'team_member_id0'; + +const body: UpdateWageSettingRequest = { + wageSetting: { + jobAssignments: [ + { + payType: 'SALARY', + jobTitle: 'Manager', + annualRate: { + amount: BigInt(3000000), + currency: 'USD', + }, + weeklyHours: 40, + }, + { + payType: 'HOURLY', + jobTitle: 'Cashier', + hourlyRate: { + amount: BigInt(2000), + currency: 'USD', + }, + } + ], + isOvertimeExempt: true, + }, +}; + +try { + const { result, ...httpResponse } = await teamApi.updateWageSetting( + teamMemberId, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/terminal.md b/legacy/doc/api/terminal.md new file mode 100644 index 000000000..e8ccd3c0b --- /dev/null +++ b/legacy/doc/api/terminal.md @@ -0,0 +1,692 @@ +# Terminal + +```ts +const terminalApi = client.terminalApi; +``` + +## Class Name + +`TerminalApi` + +## Methods + +* [Create Terminal Action](../../doc/api/terminal.md#create-terminal-action) +* [Search Terminal Actions](../../doc/api/terminal.md#search-terminal-actions) +* [Get Terminal Action](../../doc/api/terminal.md#get-terminal-action) +* [Cancel Terminal Action](../../doc/api/terminal.md#cancel-terminal-action) +* [Dismiss Terminal Action](../../doc/api/terminal.md#dismiss-terminal-action) +* [Create Terminal Checkout](../../doc/api/terminal.md#create-terminal-checkout) +* [Search Terminal Checkouts](../../doc/api/terminal.md#search-terminal-checkouts) +* [Get Terminal Checkout](../../doc/api/terminal.md#get-terminal-checkout) +* [Cancel Terminal Checkout](../../doc/api/terminal.md#cancel-terminal-checkout) +* [Dismiss Terminal Checkout](../../doc/api/terminal.md#dismiss-terminal-checkout) +* [Create Terminal Refund](../../doc/api/terminal.md#create-terminal-refund) +* [Search Terminal Refunds](../../doc/api/terminal.md#search-terminal-refunds) +* [Get Terminal Refund](../../doc/api/terminal.md#get-terminal-refund) +* [Cancel Terminal Refund](../../doc/api/terminal.md#cancel-terminal-refund) +* [Dismiss Terminal Refund](../../doc/api/terminal.md#dismiss-terminal-refund) + + +# Create Terminal Action + +Creates a Terminal action request and sends it to the specified device. + +```ts +async createTerminalAction( + body: CreateTerminalActionRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`CreateTerminalActionRequest`](../../doc/models/create-terminal-action-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CreateTerminalActionResponse`](../../doc/models/create-terminal-action-response.md) + +## Example Usage + +```ts +const body: CreateTerminalActionRequest = { + idempotencyKey: 'thahn-70e75c10-47f7-4ab6-88cc-aaa4076d065e', + action: { + deviceId: '{{DEVICE_ID}}', + deadlineDuration: 'PT5M', + type: 'SAVE_CARD', + saveCardOptions: { + customerId: '{{CUSTOMER_ID}}', + referenceId: 'user-id-1', + }, + }, +}; + +try { + const { result, ...httpResponse } = await terminalApi.createTerminalAction(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Search Terminal Actions + +Retrieves a filtered list of Terminal action requests created by the account making the request. Terminal action requests are available for 30 days. + +```ts +async searchTerminalActions( + body: SearchTerminalActionsRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`SearchTerminalActionsRequest`](../../doc/models/search-terminal-actions-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`SearchTerminalActionsResponse`](../../doc/models/search-terminal-actions-response.md) + +## Example Usage + +```ts +const body: SearchTerminalActionsRequest = { + query: { + filter: { + createdAt: { + startAt: '2022-04-01T00:00:00.000Z', + }, + }, + sort: { + sortOrder: 'DESC', + }, + }, + limit: 2, +}; + +try { + const { result, ...httpResponse } = await terminalApi.searchTerminalActions(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Get Terminal Action + +Retrieves a Terminal action request by `action_id`. Terminal action requests are available for 30 days. + +```ts +async getTerminalAction( + actionId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `actionId` | `string` | Template, Required | Unique ID for the desired `TerminalAction`. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`GetTerminalActionResponse`](../../doc/models/get-terminal-action-response.md) + +## Example Usage + +```ts +const actionId = 'action_id6'; + +try { + const { result, ...httpResponse } = await terminalApi.getTerminalAction(actionId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Cancel Terminal Action + +Cancels a Terminal action request if the status of the request permits it. + +```ts +async cancelTerminalAction( + actionId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `actionId` | `string` | Template, Required | Unique ID for the desired `TerminalAction`. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CancelTerminalActionResponse`](../../doc/models/cancel-terminal-action-response.md) + +## Example Usage + +```ts +const actionId = 'action_id6'; + +try { + const { result, ...httpResponse } = await terminalApi.cancelTerminalAction(actionId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Dismiss Terminal Action + +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. + +```ts +async dismissTerminalAction( + actionId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `actionId` | `string` | Template, Required | Unique ID for the `TerminalAction` associated with the action to be dismissed. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`DismissTerminalActionResponse`](../../doc/models/dismiss-terminal-action-response.md) + +## Example Usage + +```ts +const actionId = 'action_id6'; + +try { + const { result, ...httpResponse } = await terminalApi.dismissTerminalAction(actionId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Create Terminal Checkout + +Creates a Terminal checkout request and sends it to the specified device to take a payment +for the requested amount. + +```ts +async createTerminalCheckout( + body: CreateTerminalCheckoutRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`CreateTerminalCheckoutRequest`](../../doc/models/create-terminal-checkout-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CreateTerminalCheckoutResponse`](../../doc/models/create-terminal-checkout-response.md) + +## Example Usage + +```ts +const body: CreateTerminalCheckoutRequest = { + idempotencyKey: '28a0c3bc-7839-11ea-bc55-0242ac130003', + checkout: { + amountMoney: { + amount: BigInt(2610), + currency: 'USD', + }, + deviceOptions: { + deviceId: 'dbb5d83a-7838-11ea-bc55-0242ac130003', + }, + referenceId: 'id11572', + note: 'A brief note', + }, +}; + +try { + const { result, ...httpResponse } = await terminalApi.createTerminalCheckout(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Search Terminal Checkouts + +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. + +```ts +async searchTerminalCheckouts( + body: SearchTerminalCheckoutsRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`SearchTerminalCheckoutsRequest`](../../doc/models/search-terminal-checkouts-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`SearchTerminalCheckoutsResponse`](../../doc/models/search-terminal-checkouts-response.md) + +## Example Usage + +```ts +const body: SearchTerminalCheckoutsRequest = { + query: { + filter: { + status: 'COMPLETED', + }, + }, + limit: 2, +}; + +try { + const { result, ...httpResponse } = await terminalApi.searchTerminalCheckouts(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Get Terminal Checkout + +Retrieves a Terminal checkout request by `checkout_id`. Terminal checkout requests are available for 30 days. + +```ts +async getTerminalCheckout( + checkoutId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `checkoutId` | `string` | Template, Required | The unique ID for the desired `TerminalCheckout`. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`GetTerminalCheckoutResponse`](../../doc/models/get-terminal-checkout-response.md) + +## Example Usage + +```ts +const checkoutId = 'checkout_id8'; + +try { + const { result, ...httpResponse } = await terminalApi.getTerminalCheckout(checkoutId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Cancel Terminal Checkout + +Cancels a Terminal checkout request if the status of the request permits it. + +```ts +async cancelTerminalCheckout( + checkoutId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `checkoutId` | `string` | Template, Required | The unique ID for the desired `TerminalCheckout`. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CancelTerminalCheckoutResponse`](../../doc/models/cancel-terminal-checkout-response.md) + +## Example Usage + +```ts +const checkoutId = 'checkout_id8'; + +try { + const { result, ...httpResponse } = await terminalApi.cancelTerminalCheckout(checkoutId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Dismiss Terminal Checkout + +Dismisses a Terminal checkout request if the status and type of the request permits it. + +```ts +async dismissTerminalCheckout( + checkoutId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `checkoutId` | `string` | Template, Required | Unique ID for the `TerminalCheckout` associated with the checkout to be dismissed. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`DismissTerminalCheckoutResponse`](../../doc/models/dismiss-terminal-checkout-response.md) + +## Example Usage + +```ts +const checkoutId = 'checkout_id8'; + +try { + const { result, ...httpResponse } = await terminalApi.dismissTerminalCheckout(checkoutId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Create Terminal Refund + +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](../../doc/api/refunds.md). + +```ts +async createTerminalRefund( + body: CreateTerminalRefundRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`CreateTerminalRefundRequest`](../../doc/models/create-terminal-refund-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CreateTerminalRefundResponse`](../../doc/models/create-terminal-refund-response.md) + +## Example Usage + +```ts +const body: CreateTerminalRefundRequest = { + idempotencyKey: '402a640b-b26f-401f-b406-46f839590c04', + refund: { + paymentId: '5O5OvgkcNUhl7JBuINflcjKqUzXZY', + amountMoney: { + amount: BigInt(111), + currency: 'CAD', + }, + reason: 'Returning items', + deviceId: 'f72dfb8e-4d65-4e56-aade-ec3fb8d33291', + }, +}; + +try { + const { result, ...httpResponse } = await terminalApi.createTerminalRefund(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Search Terminal Refunds + +Retrieves a filtered list of Interac Terminal refund requests created by the seller making the request. Terminal refund requests are available for 30 days. + +```ts +async searchTerminalRefunds( + body: SearchTerminalRefundsRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`SearchTerminalRefundsRequest`](../../doc/models/search-terminal-refunds-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`SearchTerminalRefundsResponse`](../../doc/models/search-terminal-refunds-response.md) + +## Example Usage + +```ts +const body: SearchTerminalRefundsRequest = { + query: { + filter: { + status: 'COMPLETED', + }, + }, + limit: 1, +}; + +try { + const { result, ...httpResponse } = await terminalApi.searchTerminalRefunds(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Get Terminal Refund + +Retrieves an Interac Terminal refund object by ID. Terminal refund objects are available for 30 days. + +```ts +async getTerminalRefund( + terminalRefundId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `terminalRefundId` | `string` | Template, Required | The unique ID for the desired `TerminalRefund`. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`GetTerminalRefundResponse`](../../doc/models/get-terminal-refund-response.md) + +## Example Usage + +```ts +const terminalRefundId = 'terminal_refund_id0'; + +try { + const { result, ...httpResponse } = await terminalApi.getTerminalRefund(terminalRefundId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Cancel Terminal Refund + +Cancels an Interac Terminal refund request by refund request ID if the status of the request permits it. + +```ts +async cancelTerminalRefund( + terminalRefundId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `terminalRefundId` | `string` | Template, Required | The unique ID for the desired `TerminalRefund`. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CancelTerminalRefundResponse`](../../doc/models/cancel-terminal-refund-response.md) + +## Example Usage + +```ts +const terminalRefundId = 'terminal_refund_id0'; + +try { + const { result, ...httpResponse } = await terminalApi.cancelTerminalRefund(terminalRefundId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Dismiss Terminal Refund + +Dismisses a Terminal refund request if the status and type of the request permits it. + +```ts +async dismissTerminalRefund( + terminalRefundId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `terminalRefundId` | `string` | Template, Required | Unique ID for the `TerminalRefund` associated with the refund to be dismissed. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`DismissTerminalRefundResponse`](../../doc/models/dismiss-terminal-refund-response.md) + +## Example Usage + +```ts +const terminalRefundId = 'terminal_refund_id0'; + +try { + const { result, ...httpResponse } = await terminalApi.dismissTerminalRefund(terminalRefundId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/transactions.md b/legacy/doc/api/transactions.md new file mode 100644 index 000000000..6f9fbbcf4 --- /dev/null +++ b/legacy/doc/api/transactions.md @@ -0,0 +1,227 @@ +# Transactions + +```ts +const transactionsApi = client.transactionsApi; +``` + +## Class Name + +`TransactionsApi` + +## Methods + +* [List Transactions](../../doc/api/transactions.md#list-transactions) +* [Retrieve Transaction](../../doc/api/transactions.md#retrieve-transaction) +* [Capture Transaction](../../doc/api/transactions.md#capture-transaction) +* [Void Transaction](../../doc/api/transactions.md#void-transaction) + + +# List Transactions + +**This endpoint is deprecated.** + +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 + +```ts +async listTransactions( + locationId: string, + beginTime?: string, + endTime?: string, + sortOrder?: string, + cursor?: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string` | Template, Required | The ID of the location to list transactions for. | +| `beginTime` | `string \| undefined` | Query, Optional | 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. | +| `endTime` | `string \| undefined` | Query, Optional | 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. | +| `sortOrder` | [`string \| undefined`](../../doc/models/sort-order.md) | Query, Optional | The order in which results are listed in the response (`ASC` for
oldest first, `DESC` for newest first).

Default value: `DESC` | +| `cursor` | `string \| undefined` | Query, Optional | 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. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListTransactionsResponse`](../../doc/models/list-transactions-response.md) + +## Example Usage + +```ts +const locationId = 'location_id4'; + +try { + const { result, ...httpResponse } = await transactionsApi.listTransactions(locationId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Transaction + +**This endpoint is deprecated.** + +Retrieves details for a single transaction. + +```ts +async retrieveTransaction( + locationId: string, + transactionId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string` | Template, Required | The ID of the transaction's associated location. | +| `transactionId` | `string` | Template, Required | The ID of the transaction to retrieve. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveTransactionResponse`](../../doc/models/retrieve-transaction-response.md) + +## Example Usage + +```ts +const locationId = 'location_id4'; + +const transactionId = 'transaction_id8'; + +try { + const { result, ...httpResponse } = await transactionsApi.retrieveTransaction( + locationId, + transactionId +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Capture Transaction + +**This endpoint is deprecated.** + +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. + +```ts +async captureTransaction( + locationId: string, + transactionId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string` | Template, Required | - | +| `transactionId` | `string` | Template, Required | - | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CaptureTransactionResponse`](../../doc/models/capture-transaction-response.md) + +## Example Usage + +```ts +const locationId = 'location_id4'; + +const transactionId = 'transaction_id8'; + +try { + const { result, ...httpResponse } = await transactionsApi.captureTransaction( + locationId, + transactionId +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Void Transaction + +**This endpoint is deprecated.** + +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. + +```ts +async voidTransaction( + locationId: string, + transactionId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string` | Template, Required | - | +| `transactionId` | `string` | Template, Required | - | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`VoidTransactionResponse`](../../doc/models/void-transaction-response.md) + +## Example Usage + +```ts +const locationId = 'location_id4'; + +const transactionId = 'transaction_id8'; + +try { + const { result, ...httpResponse } = await transactionsApi.voidTransaction( + locationId, + transactionId +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/v1-transactions.md b/legacy/doc/api/v1-transactions.md new file mode 100644 index 000000000..806a95794 --- /dev/null +++ b/legacy/doc/api/v1-transactions.md @@ -0,0 +1,169 @@ +# V1 Transactions + +```ts +const v1TransactionsApi = client.v1TransactionsApi; +``` + +## Class Name + +`V1TransactionsApi` + +## Methods + +* [V1 List Orders](../../doc/api/v1-transactions.md#v1-list-orders) +* [V1 Retrieve Order](../../doc/api/v1-transactions.md#v1-retrieve-order) +* [V1 Update Order](../../doc/api/v1-transactions.md#v1-update-order) + + +# V1 List Orders + +**This endpoint is deprecated.** + +Provides summary information for a merchant's online store orders. + +```ts +async v1ListOrders( + locationId: string, + order?: string, + limit?: number, + batchToken?: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string` | Template, Required | The ID of the location to list online store orders for. | +| `order` | [`string \| undefined`](../../doc/models/sort-order.md) | Query, Optional | The order in which payments are listed in the response. | +| `limit` | `number \| undefined` | Query, Optional | The maximum number of payments to return in a single response. This value cannot exceed 200. | +| `batchToken` | `string \| undefined` | Query, Optional | A pagination cursor to retrieve the next set of results for your
original query to the endpoint. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`V1Order[]`](../../doc/models/v1-order.md) + +## Example Usage + +```ts +const locationId = 'location_id4'; + +try { + const { result, ...httpResponse } = await v1TransactionsApi.v1ListOrders(locationId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# V1 Retrieve Order + +**This endpoint is deprecated.** + +Provides comprehensive information for a single online store order, including the order's history. + +```ts +async v1RetrieveOrder( + locationId: string, + orderId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string` | Template, Required | The ID of the order's associated location. | +| `orderId` | `string` | Template, Required | The order's Square-issued ID. You obtain this value from Order objects returned by the List Orders endpoint | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`V1Order`](../../doc/models/v1-order.md) + +## Example Usage + +```ts +const locationId = 'location_id4'; + +const orderId = 'order_id6'; + +try { + const { result, ...httpResponse } = await v1TransactionsApi.v1RetrieveOrder( + locationId, + orderId +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# V1 Update Order + +**This endpoint is deprecated.** + +Updates the details of an online store order. Every update you perform on an order corresponds to one of three actions: + +```ts +async v1UpdateOrder( + locationId: string, + orderId: string, + body: V1UpdateOrderRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string` | Template, Required | The ID of the order's associated location. | +| `orderId` | `string` | Template, Required | The order's Square-issued ID. You obtain this value from Order objects returned by the List Orders endpoint | +| `body` | [`V1UpdateOrderRequest`](../../doc/models/v1-update-order-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`V1Order`](../../doc/models/v1-order.md) + +## Example Usage + +```ts +const locationId = 'location_id4'; + +const orderId = 'order_id6'; + +const body: V1UpdateOrderRequest = { + action: 'REFUND', +}; + +try { + const { result, ...httpResponse } = await v1TransactionsApi.v1UpdateOrder( + locationId, + orderId, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/vendors.md b/legacy/doc/api/vendors.md new file mode 100644 index 000000000..9d1427926 --- /dev/null +++ b/legacy/doc/api/vendors.md @@ -0,0 +1,340 @@ +# Vendors + +```ts +const vendorsApi = client.vendorsApi; +``` + +## Class Name + +`VendorsApi` + +## Methods + +* [Bulk Create Vendors](../../doc/api/vendors.md#bulk-create-vendors) +* [Bulk Retrieve Vendors](../../doc/api/vendors.md#bulk-retrieve-vendors) +* [Bulk Update Vendors](../../doc/api/vendors.md#bulk-update-vendors) +* [Create Vendor](../../doc/api/vendors.md#create-vendor) +* [Search Vendors](../../doc/api/vendors.md#search-vendors) +* [Retrieve Vendor](../../doc/api/vendors.md#retrieve-vendor) +* [Update Vendor](../../doc/api/vendors.md#update-vendor) + + +# Bulk Create Vendors + +Creates one or more [Vendor](../../doc/models/vendor.md) objects to represent suppliers to a seller. + +```ts +async bulkCreateVendors( + body: BulkCreateVendorsRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BulkCreateVendorsRequest`](../../doc/models/bulk-create-vendors-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`BulkCreateVendorsResponse`](../../doc/models/bulk-create-vendors-response.md) + +## Example Usage + +```ts +const body: BulkCreateVendorsRequest = { + vendors: { + 'key0': { + }, + 'key1': { + } + }, +}; + +try { + const { result, ...httpResponse } = await vendorsApi.bulkCreateVendors(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Bulk Retrieve Vendors + +Retrieves one or more vendors of specified [Vendor](../../doc/models/vendor.md) IDs. + +```ts +async bulkRetrieveVendors( + body: BulkRetrieveVendorsRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BulkRetrieveVendorsRequest`](../../doc/models/bulk-retrieve-vendors-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`BulkRetrieveVendorsResponse`](../../doc/models/bulk-retrieve-vendors-response.md) + +## Example Usage + +```ts +const body: BulkRetrieveVendorsRequest = { + vendorIds: [ + 'INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4' + ], +}; + +try { + const { result, ...httpResponse } = await vendorsApi.bulkRetrieveVendors(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Bulk Update Vendors + +Updates one or more of existing [Vendor](../../doc/models/vendor.md) objects as suppliers to a seller. + +```ts +async bulkUpdateVendors( + body: BulkUpdateVendorsRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`BulkUpdateVendorsRequest`](../../doc/models/bulk-update-vendors-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`BulkUpdateVendorsResponse`](../../doc/models/bulk-update-vendors-response.md) + +## Example Usage + +```ts +const body: BulkUpdateVendorsRequest = { + vendors: { + 'key0': { + vendor: { + }, + }, + 'key1': { + vendor: { + }, + } + }, +}; + +try { + const { result, ...httpResponse } = await vendorsApi.bulkUpdateVendors(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Create Vendor + +Creates a single [Vendor](../../doc/models/vendor.md) object to represent a supplier to a seller. + +```ts +async createVendor( + body: CreateVendorRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`CreateVendorRequest`](../../doc/models/create-vendor-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CreateVendorResponse`](../../doc/models/create-vendor-response.md) + +## Example Usage + +```ts +const body: CreateVendorRequest = { + idempotencyKey: 'idempotency_key2', +}; + +try { + const { result, ...httpResponse } = await vendorsApi.createVendor(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Search Vendors + +Searches for vendors using a filter against supported [Vendor](../../doc/models/vendor.md) properties and a supported sorter. + +```ts +async searchVendors( + body: SearchVendorsRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`SearchVendorsRequest`](../../doc/models/search-vendors-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`SearchVendorsResponse`](../../doc/models/search-vendors-response.md) + +## Example Usage + +```ts +const body: SearchVendorsRequest = { +}; + +try { + const { result, ...httpResponse } = await vendorsApi.searchVendors(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Vendor + +Retrieves the vendor of a specified [Vendor](../../doc/models/vendor.md) ID. + +```ts +async retrieveVendor( + vendorId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `vendorId` | `string` | Template, Required | ID of the [Vendor](entity:Vendor) to retrieve. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveVendorResponse`](../../doc/models/retrieve-vendor-response.md) + +## Example Usage + +```ts +const vendorId = 'vendor_id8'; + +try { + const { result, ...httpResponse } = await vendorsApi.retrieveVendor(vendorId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Update Vendor + +Updates an existing [Vendor](../../doc/models/vendor.md) object as a supplier to a seller. + +```ts +async updateVendor( + body: UpdateVendorRequest, + vendorId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`UpdateVendorRequest`](../../doc/models/update-vendor-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `vendorId` | `string` | Template, Required | - | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`UpdateVendorResponse`](../../doc/models/update-vendor-response.md) + +## Example Usage + +```ts +const body: UpdateVendorRequest = { + vendor: { + id: 'INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4', + name: 'Jack\'s Chicken Shack', + version: 1, + status: 'ACTIVE', + }, + idempotencyKey: '8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe', +}; + +const vendorId = 'vendor_id8'; + +try { + const { result, ...httpResponse } = await vendorsApi.updateVendor( + body, + vendorId +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/api/webhook-subscriptions.md b/legacy/doc/api/webhook-subscriptions.md new file mode 100644 index 000000000..cfea437f6 --- /dev/null +++ b/legacy/doc/api/webhook-subscriptions.md @@ -0,0 +1,389 @@ +# Webhook Subscriptions + +```ts +const webhookSubscriptionsApi = client.webhookSubscriptionsApi; +``` + +## Class Name + +`WebhookSubscriptionsApi` + +## Methods + +* [List Webhook Event Types](../../doc/api/webhook-subscriptions.md#list-webhook-event-types) +* [List Webhook Subscriptions](../../doc/api/webhook-subscriptions.md#list-webhook-subscriptions) +* [Create Webhook Subscription](../../doc/api/webhook-subscriptions.md#create-webhook-subscription) +* [Delete Webhook Subscription](../../doc/api/webhook-subscriptions.md#delete-webhook-subscription) +* [Retrieve Webhook Subscription](../../doc/api/webhook-subscriptions.md#retrieve-webhook-subscription) +* [Update Webhook Subscription](../../doc/api/webhook-subscriptions.md#update-webhook-subscription) +* [Update Webhook Subscription Signature Key](../../doc/api/webhook-subscriptions.md#update-webhook-subscription-signature-key) +* [Test Webhook Subscription](../../doc/api/webhook-subscriptions.md#test-webhook-subscription) + + +# List Webhook Event Types + +Lists all webhook event types that can be subscribed to. + +```ts +async listWebhookEventTypes( + apiVersion?: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `apiVersion` | `string \| undefined` | Query, Optional | The API version for which to list event types. Setting this field overrides the default version used by the application. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListWebhookEventTypesResponse`](../../doc/models/list-webhook-event-types-response.md) + +## Example Usage + +```ts +try { + const { result, ...httpResponse } = await webhookSubscriptionsApi.listWebhookEventTypes(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# List Webhook Subscriptions + +Lists all webhook subscriptions owned by your application. + +```ts +async listWebhookSubscriptions( + cursor?: string, + includeDisabled?: boolean, + sortOrder?: string, + limit?: number, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `cursor` | `string \| undefined` | Query, Optional | 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). | +| `includeDisabled` | `boolean \| undefined` | Query, Optional | Includes disabled [Subscription](entity:WebhookSubscription)s.
By default, all enabled [Subscription](entity:WebhookSubscription)s are returned.
**Default**: `false` | +| `sortOrder` | [`string \| undefined`](../../doc/models/sort-order.md) | Query, Optional | Sorts the returned list by when the [Subscription](entity:WebhookSubscription) was created with the specified order.
This field defaults to ASC. | +| `limit` | `number \| undefined` | Query, Optional | 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 | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`ListWebhookSubscriptionsResponse`](../../doc/models/list-webhook-subscriptions-response.md) + +## Example Usage + +```ts +const includeDisabled = false; + +try { + const { result, ...httpResponse } = await webhookSubscriptionsApi.listWebhookSubscriptions( + undefined, + includeDisabled +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Create Webhook Subscription + +Creates a webhook subscription. + +```ts +async createWebhookSubscription( + body: CreateWebhookSubscriptionRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `body` | [`CreateWebhookSubscriptionRequest`](../../doc/models/create-webhook-subscription-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`CreateWebhookSubscriptionResponse`](../../doc/models/create-webhook-subscription-response.md) + +## Example Usage + +```ts +const body: CreateWebhookSubscriptionRequest = { + subscription: { + name: 'Example Webhook Subscription', + eventTypes: [ + 'payment.created', + 'payment.updated' + ], + notificationUrl: 'https://example-webhook-url.com', + apiVersion: '2021-12-15', + }, + idempotencyKey: '63f84c6c-2200-4c99-846c-2670a1311fbf', +}; + +try { + const { result, ...httpResponse } = await webhookSubscriptionsApi.createWebhookSubscription(body); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Delete Webhook Subscription + +Deletes a webhook subscription. + +```ts +async deleteWebhookSubscription( + subscriptionId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `string` | Template, Required | [REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to delete. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`DeleteWebhookSubscriptionResponse`](../../doc/models/delete-webhook-subscription-response.md) + +## Example Usage + +```ts +const subscriptionId = 'subscription_id0'; + +try { + const { result, ...httpResponse } = await webhookSubscriptionsApi.deleteWebhookSubscription(subscriptionId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Retrieve Webhook Subscription + +Retrieves a webhook subscription identified by its ID. + +```ts +async retrieveWebhookSubscription( + subscriptionId: string, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `string` | Template, Required | [REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to retrieve. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`RetrieveWebhookSubscriptionResponse`](../../doc/models/retrieve-webhook-subscription-response.md) + +## Example Usage + +```ts +const subscriptionId = 'subscription_id0'; + +try { + const { result, ...httpResponse } = await webhookSubscriptionsApi.retrieveWebhookSubscription(subscriptionId); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Update Webhook Subscription + +Updates a webhook subscription. + +```ts +async updateWebhookSubscription( + subscriptionId: string, + body: UpdateWebhookSubscriptionRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `string` | Template, Required | [REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to update. | +| `body` | [`UpdateWebhookSubscriptionRequest`](../../doc/models/update-webhook-subscription-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`UpdateWebhookSubscriptionResponse`](../../doc/models/update-webhook-subscription-response.md) + +## Example Usage + +```ts +const subscriptionId = 'subscription_id0'; + +const body: UpdateWebhookSubscriptionRequest = { + subscription: { + name: 'Updated Example Webhook Subscription', + enabled: false, + }, +}; + +try { + const { result, ...httpResponse } = await webhookSubscriptionsApi.updateWebhookSubscription( + subscriptionId, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Update Webhook Subscription Signature Key + +Updates a webhook subscription by replacing the existing signature key with a new one. + +```ts +async updateWebhookSubscriptionSignatureKey( + subscriptionId: string, + body: UpdateWebhookSubscriptionSignatureKeyRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `string` | Template, Required | [REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to update. | +| `body` | [`UpdateWebhookSubscriptionSignatureKeyRequest`](../../doc/models/update-webhook-subscription-signature-key-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`UpdateWebhookSubscriptionSignatureKeyResponse`](../../doc/models/update-webhook-subscription-signature-key-response.md) + +## Example Usage + +```ts +const subscriptionId = 'subscription_id0'; + +const body: UpdateWebhookSubscriptionSignatureKeyRequest = { + idempotencyKey: 'ed80ae6b-0654-473b-bbab-a39aee89a60d', +}; + +try { + const { result, ...httpResponse } = await webhookSubscriptionsApi.updateWebhookSubscriptionSignatureKey( + subscriptionId, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + + +# Test Webhook Subscription + +Tests a webhook subscription by sending a test event to the notification URL. + +```ts +async testWebhookSubscription( + subscriptionId: string, + body: TestWebhookSubscriptionRequest, + requestOptions?: RequestOptions +): Promise> +``` + +## Parameters + +| Parameter | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscriptionId` | `string` | Template, Required | [REQUIRED] The ID of the [Subscription](entity:WebhookSubscription) to test. | +| `body` | [`TestWebhookSubscriptionRequest`](../../doc/models/test-webhook-subscription-request.md) | Body, Required | An object containing the fields to POST for the request.

See the corresponding object definition for field details. | +| `requestOptions` | `RequestOptions \| undefined` | Optional | Pass additional request options. | + +## Response Type + +[`TestWebhookSubscriptionResponse`](../../doc/models/test-webhook-subscription-response.md) + +## Example Usage + +```ts +const subscriptionId = 'subscription_id0'; + +const body: TestWebhookSubscriptionRequest = { + eventType: 'payment.created', +}; + +try { + const { result, ...httpResponse } = await webhookSubscriptionsApi.testWebhookSubscription( + subscriptionId, + body +); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + diff --git a/legacy/doc/auth/oauth-2-bearer-token.md b/legacy/doc/auth/oauth-2-bearer-token.md new file mode 100644 index 000000000..a21193950 --- /dev/null +++ b/legacy/doc/auth/oauth-2-bearer-token.md @@ -0,0 +1,32 @@ + +# OAuth 2 Bearer token + + + +Documentation for accessing and setting credentials for global. + +## Auth Credentials + +| Name | Type | Description | Setter | +| --- | --- | --- | --- | +| AccessToken | `string` | The OAuth 2.0 Access Token to use for API requests. | `accessToken` | + + + +**Note:** Auth credentials can be set using `bearerAuthCredentials` object in the client. + +## Usage Example + +### Client Initialization + +You must provide credentials in the client as shown in the following code snippet. + +```ts +const client = new Client({ + bearerAuthCredentials: { + accessToken: 'AccessToken' + }, +}); +``` + + diff --git a/legacy/doc/client.md b/legacy/doc/client.md new file mode 100644 index 000000000..82130bf5c --- /dev/null +++ b/legacy/doc/client.md @@ -0,0 +1,136 @@ + +# Client Class Documentation + +The following parameters are configurable for the API Client: + +| Parameter | Type | Description | +| --- | --- | --- | +| `squareVersion` | `string` | Square Connect API versions
*Default*: `'2024-12-18'` | +| `customUrl` | `string` | Sets the base URL requests are made to. Defaults to `https://connect.squareup.com`
*Default*: `'https://connect.squareup.com'` | +| `environment` | `string` | The API environment.
**Default: `production`** | +| `additionalHeaders` | `Readonly>` | Additional headers to add to each API call
*Default*: `{}` | +| `userAgentDetail` | `string` | User agent detail to append in the user agent header
*Default*: `"''"` | +| `timeout` | `number` | Timeout for API calls.
*Default*: `60000` | +| `httpClientOptions` | `Partial` | Stable configurable http client options. | +| `unstableHttpClientOptions` | `any` | Unstable configurable http client options. | +| `bearerAuthCredentials` | [`BearerAuthCredentials`](auth/oauth-2-bearer-token.md) | The credential object for bearerAuth | + +## HttpClientOptions + +| Parameter | Type | Description | +| --- | --- | --- | +| `timeout` | `number` | Timeout in milliseconds. | +| `httpAgent` | `any` | Custom http agent to be used when performing http requests. | +| `httpsAgent` | `any` | Custom https agent to be used when performing http requests. | +| `retryConfig` | `Partial` | Configurations to retry requests. | + +## RetryConfiguration + +| Parameter | Type | Description | +| --- | --- | --- | +| `maxNumberOfRetries` | `number` | Maximum number of retries.
*Default*: `0` | +| `retryOnTimeout` | `boolean` | Whether to retry on request timeout.
*Default*: `true` | +| `retryInterval` | `number` | Interval before next retry. Used in calculation of wait time for next request in case of failure.
*Default*: `1` | +| `maximumRetryWaitTime` | `number` | Overall wait time for the requests getting retried.
*Default*: `0` | +| `backoffFactor` | `number` | Used in calculation of wait time for next request in case of failure.
*Default*: `2` | +| `httpStatusCodesToRetry` | `number[]` | Http status codes to retry against.
*Default*: `[408, 413, 429, 500, 502, 503, 504, 521, 522, 524]` | +| `httpMethodsToRetry` | `HttpMethod[]` | Http methods to retry against.
*Default*: `['GET', 'PUT']` | + +The API client can be initialized as follows: + +```ts +const client = new Client({ + bearerAuthCredentials: { + accessToken: 'AccessToken' + }, + squareVersion: '2024-12-18', + timeout: 60000, + additionalHeaders: {}, + userAgentDetail: '', + environment: Environment.Production, + customUrl: 'https://connect.squareup.com', +}); +``` + +## Make Calls with the API Client + +```ts +import { ApiError, Client, Environment } from 'square/legacy'; + +const client = new Client({ + bearerAuthCredentials: { + accessToken: 'AccessToken' + }, + squareVersion: '2024-12-18', + timeout: 60000, + additionalHeaders: {}, + userAgentDetail: '', + environment: Environment.Production, + customUrl: 'https://connect.squareup.com', +}); + +const locationsApi = client.locationsApi; + +try { + const { result, ...httpResponse } = await locationsApi.listLocations(); + // Get more response info... + // const { statusCode, headers } = httpResponse; +} catch (error) { + if (error instanceof ApiError) { + const errors = error.result; + // const { statusCode, headers } = error; + } +} +``` + +## Square Client + +The gateway for the SDK. This class acts as a factory for the Apis and also holds the configuration of the SDK. + +## API + +| Name | Description | +| --- | --- | +| mobileAuthorization | Gets MobileAuthorizationApi | +| oAuth | Gets OAuthApi | +| v1Transactions | Gets V1TransactionsApi | +| applePay | Gets ApplePayApi | +| bankAccounts | Gets BankAccountsApi | +| bookings | Gets BookingsApi | +| bookingCustomAttributes | Gets BookingCustomAttributesApi | +| cards | Gets CardsApi | +| cashDrawers | Gets CashDrawersApi | +| catalog | Gets CatalogApi | +| customers | Gets CustomersApi | +| customerCustomAttributes | Gets CustomerCustomAttributesApi | +| customerGroups | Gets CustomerGroupsApi | +| customerSegments | Gets CustomerSegmentsApi | +| devices | Gets DevicesApi | +| disputes | Gets DisputesApi | +| employees | Gets EmployeesApi | +| events | Gets EventsApi | +| giftCards | Gets GiftCardsApi | +| giftCardActivities | Gets GiftCardActivitiesApi | +| inventory | Gets InventoryApi | +| invoices | Gets InvoicesApi | +| labor | Gets LaborApi | +| locations | Gets LocationsApi | +| locationCustomAttributes | Gets LocationCustomAttributesApi | +| checkout | Gets CheckoutApi | +| transactions | Gets TransactionsApi | +| loyalty | Gets LoyaltyApi | +| merchants | Gets MerchantsApi | +| merchantCustomAttributes | Gets MerchantCustomAttributesApi | +| orders | Gets OrdersApi | +| orderCustomAttributes | Gets OrderCustomAttributesApi | +| payments | Gets PaymentsApi | +| payouts | Gets PayoutsApi | +| refunds | Gets RefundsApi | +| sites | Gets SitesApi | +| snippets | Gets SnippetsApi | +| subscriptions | Gets SubscriptionsApi | +| team | Gets TeamApi | +| terminal | Gets TerminalApi | +| vendors | Gets VendorsApi | +| webhookSubscriptions | Gets WebhookSubscriptionsApi | + diff --git a/legacy/doc/models/accept-dispute-response.md b/legacy/doc/models/accept-dispute-response.md new file mode 100644 index 000000000..c9521657d --- /dev/null +++ b/legacy/doc/models/accept-dispute-response.md @@ -0,0 +1,64 @@ + +# Accept Dispute Response + +Defines the fields in an `AcceptDispute` response. + +## Structure + +`AcceptDisputeResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | +| `dispute` | [`Dispute \| undefined`](../../doc/models/dispute.md) | Optional | Represents a [dispute](https://developer.squareup.com/docs/disputes-api/overview) a cardholder initiated with their bank. | + +## Example (as JSON) + +```json +{ + "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, + "dispute_id": "dispute_id8" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/accepted-payment-methods.md b/legacy/doc/models/accepted-payment-methods.md new file mode 100644 index 000000000..c410e19ea --- /dev/null +++ b/legacy/doc/models/accepted-payment-methods.md @@ -0,0 +1,27 @@ + +# Accepted Payment Methods + +## Structure + +`AcceptedPaymentMethods` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `applePay` | `boolean \| null \| undefined` | Optional | Whether Apple Pay is accepted at checkout. | +| `googlePay` | `boolean \| null \| undefined` | Optional | Whether Google Pay is accepted at checkout. | +| `cashAppPay` | `boolean \| null \| undefined` | Optional | Whether Cash App Pay is accepted at checkout. | +| `afterpayClearpay` | `boolean \| null \| undefined` | Optional | Whether Afterpay/Clearpay is accepted at checkout. | + +## Example (as JSON) + +```json +{ + "apple_pay": false, + "google_pay": false, + "cash_app_pay": false, + "afterpay_clearpay": false +} +``` + diff --git a/legacy/doc/models/accumulate-loyalty-points-request.md b/legacy/doc/models/accumulate-loyalty-points-request.md new file mode 100644 index 000000000..2ac861f07 --- /dev/null +++ b/legacy/doc/models/accumulate-loyalty-points-request.md @@ -0,0 +1,31 @@ + +# Accumulate Loyalty Points Request + +Represents an [AccumulateLoyaltyPoints](../../doc/api/loyalty.md#accumulate-loyalty-points) request. + +## Structure + +`AccumulateLoyaltyPointsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `accumulatePoints` | [`LoyaltyEventAccumulatePoints`](../../doc/models/loyalty-event-accumulate-points.md) | Required | Provides metadata when the event `type` is `ACCUMULATE_POINTS`. | +| `idempotencyKey` | `string` | Required | A unique string that identifies the `AccumulateLoyaltyPoints` request.
Keys can be any valid string but must be unique for every request.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128` | +| `locationId` | `string` | Required | The [location](entity:Location) where the purchase was made. | + +## Example (as JSON) + +```json +{ + "accumulate_points": { + "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY", + "loyalty_program_id": "loyalty_program_id8", + "points": 118 + }, + "idempotency_key": "58b90739-c3e8-4b11-85f7-e636d48d72cb", + "location_id": "P034NEENMD09F" +} +``` + diff --git a/legacy/doc/models/accumulate-loyalty-points-response.md b/legacy/doc/models/accumulate-loyalty-points-response.md new file mode 100644 index 000000000..cde362ed6 --- /dev/null +++ b/legacy/doc/models/accumulate-loyalty-points-response.md @@ -0,0 +1,99 @@ + +# Accumulate Loyalty Points Response + +Represents an [AccumulateLoyaltyPoints](../../doc/api/loyalty.md#accumulate-loyalty-points) response. + +## Structure + +`AccumulateLoyaltyPointsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `event` | [`LoyaltyEvent \| undefined`](../../doc/models/loyalty-event.md) | Optional | 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). | +| `events` | [`LoyaltyEvent[] \| undefined`](../../doc/models/loyalty-event.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "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", + "create_reward": { + "loyalty_program_id": "loyalty_program_id2", + "reward_id": "reward_id6", + "points": 90 + }, + "redeem_reward": { + "loyalty_program_id": "loyalty_program_id8", + "reward_id": "reward_id2", + "order_id": "order_id8" + }, + "delete_reward": { + "loyalty_program_id": "loyalty_program_id4", + "reward_id": "reward_id8", + "points": 104 + }, + "adjust_points": { + "loyalty_program_id": "loyalty_program_id2", + "points": 96, + "reason": "reason2" + } + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "event": { + "id": "id0", + "type": "ADJUST_POINTS", + "created_at": "created_at8", + "accumulate_points": { + "loyalty_program_id": "loyalty_program_id8", + "points": 118, + "order_id": "order_id8" + }, + "create_reward": { + "loyalty_program_id": "loyalty_program_id2", + "reward_id": "reward_id6", + "points": 90 + }, + "redeem_reward": { + "loyalty_program_id": "loyalty_program_id8", + "reward_id": "reward_id2", + "order_id": "order_id8" + }, + "delete_reward": { + "loyalty_program_id": "loyalty_program_id4", + "reward_id": "reward_id8", + "points": 104 + }, + "adjust_points": { + "loyalty_program_id": "loyalty_program_id2", + "points": 96, + "reason": "reason2" + }, + "loyalty_account_id": "loyalty_account_id0", + "source": "SQUARE" + } +} +``` + diff --git a/legacy/doc/models/ach-details.md b/legacy/doc/models/ach-details.md new file mode 100644 index 000000000..614a12b7a --- /dev/null +++ b/legacy/doc/models/ach-details.md @@ -0,0 +1,27 @@ + +# ACH Details + +ACH-specific details about `BANK_ACCOUNT` type payments with the `transfer_type` of `ACH`. + +## Structure + +`ACHDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `routingNumber` | `string \| null \| undefined` | Optional | The routing number for the bank account.
**Constraints**: *Maximum Length*: `50` | +| `accountNumberSuffix` | `string \| null \| undefined` | Optional | The last few digits of the bank account number.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `4` | +| `accountType` | `string \| null \| undefined` | Optional | The type of the bank account performing the transfer. The account type can be `CHECKING`,
`SAVINGS`, or `UNKNOWN`.
**Constraints**: *Maximum Length*: `50` | + +## Example (as JSON) + +```json +{ + "routing_number": "routing_number6", + "account_number_suffix": "account_number_suffix6", + "account_type": "account_type8" +} +``` + diff --git a/legacy/doc/models/action-cancel-reason.md b/legacy/doc/models/action-cancel-reason.md new file mode 100644 index 000000000..c3d54bfb5 --- /dev/null +++ b/legacy/doc/models/action-cancel-reason.md @@ -0,0 +1,15 @@ + +# Action Cancel Reason + +## Enumeration + +`ActionCancelReason` + +## Fields + +| Name | Description | +| --- | --- | +| `BUYER_CANCELED` | A person canceled the `TerminalCheckout` from a Square device. | +| `SELLER_CANCELED` | A client canceled the `TerminalCheckout` using the API. | +| `TIMED_OUT` | The `TerminalCheckout` timed out (see `deadline_duration` on the `TerminalCheckout`). | + diff --git a/legacy/doc/models/activity-type.md b/legacy/doc/models/activity-type.md new file mode 100644 index 000000000..04577ccd8 --- /dev/null +++ b/legacy/doc/models/activity-type.md @@ -0,0 +1,70 @@ + +# Activity Type + +## Enumeration + +`ActivityType` + +## Fields + +| Name | Description | +| --- | --- | +| `ADJUSTMENT` | A manual adjustment applied to the seller's account by Square. | +| `APP_FEE_REFUND` | A refund for an application fee on a payment. | +| `APP_FEE_REVENUE` | Revenue generated from an application fee on a payment. | +| `AUTOMATIC_SAVINGS` | An automatic transfer from the payment processing balance to the Square Savings account. These are generally proportional to the seller's sales. | +| `AUTOMATIC_SAVINGS_REVERSED` | An automatic transfer from the Square Savings account back to the processing balance. These are generally proportional to the seller's refunds. | +| `CHARGE` | A credit card payment capture. | +| `DEPOSIT_FEE` | A fee assessed because of a deposit, such as an instant deposit. | +| `DEPOSIT_FEE_REVERSED` | 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. | +| `DISPUTE` | The balance change due to a dispute event. | +| `ESCHEATMENT` | An escheatment entry for remittance. | +| `FEE` | The cost plus adjustment fee. | +| `FREE_PROCESSING` | Square offers free payments processing for a variety of business scenarios, including seller
referrals or when Square wants to apologize (for example, for a bug, customer service, or repricing complication).
This entry represents a credit to the seller for the purposes of free processing. | +| `HOLD_ADJUSTMENT` | An adjustment made by Square related to holding a payment. | +| `INITIAL_BALANCE_CHANGE` | 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). | +| `MONEY_TRANSFER` | The balance change from a money transfer. | +| `MONEY_TRANSFER_REVERSAL` | The reversal of a money transfer. | +| `OPEN_DISPUTE` | The balance change for a chargeback that's been filed. | +| `OTHER` | Any other type that doesn't belong in the rest of the types. | +| `OTHER_ADJUSTMENT` | Any other type of adjustment that doesn't fall under existing types. | +| `PAID_SERVICE_FEE` | A fee paid to a third-party seller. | +| `PAID_SERVICE_FEE_REFUND` | A fee refunded to a third-party seller. | +| `REDEMPTION_CODE` | Repayment for a redemption code. | +| `REFUND` | A refund for an existing card payment. | +| `RELEASE_ADJUSTMENT` | An adjustment made by Square related to releasing a payment. | +| `RESERVE_HOLD` | Fees paid for a funding risk reserve. | +| `RESERVE_RELEASE` | Fees released from a risk reserve. | +| `RETURNED_PAYOUT` | An entry created when Square receives a response for the ACH file that Square sent indicating that the
settlement of the original entry failed. | +| `SQUARE_CAPITAL_PAYMENT` | 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. | +| `SQUARE_CAPITAL_REVERSED_PAYMENT` | 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. | +| `SUBSCRIPTION_FEE` | A fee charged for subscription to a Square product. | +| `SUBSCRIPTION_FEE_PAID_REFUND` | A Square subscription fee that's been refunded. | +| `SUBSCRIPTION_FEE_REFUND` | The refund of a previously charged Square product subscription fee. | +| `TAX_ON_FEE` | The tax paid on fee amounts. | +| `THIRD_PARTY_FEE` | Fees collected by a third-party platform. | +| `THIRD_PARTY_FEE_REFUND` | Refunded fees from a third-party platform. | +| `PAYOUT` | The balance change due to a money transfer. Note that this type is never returned by the Payouts API. | +| `AUTOMATIC_BITCOIN_CONVERSIONS` | 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. | +| `AUTOMATIC_BITCOIN_CONVERSIONS_REVERSED` | Indicates that a withheld payment, which was scheduled to be converted into bitcoin using Cash App, was deposited back to the Square payments balance. | +| `CREDIT_CARD_REPAYMENT` | Indicates that a repayment toward the outstanding balance on the seller's Square credit card was made. | +| `CREDIT_CARD_REPAYMENT_REVERSED` | Indicates that a repayment toward the outstanding balance on the seller's Square credit card was reversed. | +| `LOCAL_OFFERS_CASHBACK` | Cashback amount given by a Square Local Offers seller to their customer for a purchase. | +| `LOCAL_OFFERS_FEE` | A commission fee paid by a Square Local Offers seller to Square for a purchase discovered through Square Local Offers. | +| `PERCENTAGE_PROCESSING_ENROLLMENT` | When activating Percentage Processing, a credit is applied to the seller’s account to offset any negative balance caused by a dispute. | +| `PERCENTAGE_PROCESSING_DEACTIVATION` | 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. | +| `PERCENTAGE_PROCESSING_REPAYMENT` | 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. | +| `PERCENTAGE_PROCESSING_REPAYMENT_REVERSED` | The reversal of a percentage processing repayment that happens for example when a refund is issued for a payment. | +| `PROCESSING_FEE` | 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. | +| `PROCESSING_FEE_REFUND` | 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. | +| `UNDO_PROCESSING_FEE_REFUND` | When undoing a processing fee refund in a Gross Settlement payment, this payout entry type is used. | +| `GIFT_CARD_LOAD_FEE` | 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. | +| `GIFT_CARD_LOAD_FEE_REFUND` | Refund for fee charged during the sale or reload of a gift card. | +| `UNDO_GIFT_CARD_LOAD_FEE_REFUND` | The undo of a refund for a fee charged during the sale or reload of a gift card. | +| `BALANCE_FOLDERS_TRANSFER` | A transfer of funds to a banking folder. In the United States, the folder name is 'Checking Folder'; in Canada, it's 'Balance Folder.' | +| `BALANCE_FOLDERS_TRANSFER_REVERSED` | 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.' | +| `GIFT_CARD_POOL_TRANSFER` | 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. | +| `GIFT_CARD_POOL_TRANSFER_REVERSED` | 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. | +| `SQUARE_PAYROLL_TRANSFER` | A payroll payment that was transferred to a team member’s bank account. | +| `SQUARE_PAYROLL_TRANSFER_REVERSED` | A payroll payment to a team member’s bank account that was deposited back to the seller’s account by Square. | + diff --git a/legacy/doc/models/add-group-to-customer-response.md b/legacy/doc/models/add-group-to-customer-response.md new file mode 100644 index 000000000..6c1ad7b9d --- /dev/null +++ b/legacy/doc/models/add-group-to-customer-response.md @@ -0,0 +1,31 @@ + +# Add Group to Customer Response + +Defines the fields that are included in the response body of +a request to the [AddGroupToCustomer](../../doc/api/customers.md#add-group-to-customer) endpoint. + +## Structure + +`AddGroupToCustomerResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/additional-recipient.md b/legacy/doc/models/additional-recipient.md new file mode 100644 index 000000000..1f7e4e37c --- /dev/null +++ b/legacy/doc/models/additional-recipient.md @@ -0,0 +1,32 @@ + +# Additional Recipient + +Represents an additional recipient (other than the merchant) receiving a portion of this tender. + +## Structure + +`AdditionalRecipient` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string` | Required | The location ID for a recipient (other than the merchant) receiving a portion of this tender.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `50` | +| `description` | `string \| null \| undefined` | Optional | The description of the additional recipient.
**Constraints**: *Maximum Length*: `100` | +| `amountMoney` | [`Money`](../../doc/models/money.md) | Required | 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. | +| `receivableId` | `string \| null \| undefined` | Optional | The unique ID for the RETIRED `AdditionalRecipientReceivable` object. This field should be empty for any `AdditionalRecipient` objects created after the retirement.
**Constraints**: *Maximum Length*: `192` | + +## Example (as JSON) + +```json +{ + "location_id": "location_id2", + "description": "description2", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "receivable_id": "receivable_id8" +} +``` + diff --git a/legacy/doc/models/address.md b/legacy/doc/models/address.md new file mode 100644 index 000000000..2334fc0e1 --- /dev/null +++ b/legacy/doc/models/address.md @@ -0,0 +1,41 @@ + +# Address + +Represents a postal address in a country. +For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). + +## Structure + +`Address` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `addressLine1` | `string \| null \| undefined` | Optional | 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). | +| `addressLine2` | `string \| null \| undefined` | Optional | The second line of the address, if any. | +| `addressLine3` | `string \| null \| undefined` | Optional | The third line of the address, if any. | +| `locality` | `string \| null \| undefined` | Optional | 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` | `string \| null \| undefined` | Optional | A civil region within the address's `locality`, if any. | +| `sublocality2` | `string \| null \| undefined` | Optional | A civil region within the address's `sublocality`, if any. | +| `sublocality3` | `string \| null \| undefined` | Optional | A civil region within the address's `sublocality_2`, if any. | +| `administrativeDistrictLevel1` | `string \| null \| undefined` | Optional | 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). | +| `administrativeDistrictLevel2` | `string \| null \| undefined` | Optional | A civil entity within the address's `administrative_district_level_1`.
In the US, this is the county. | +| `administrativeDistrictLevel3` | `string \| null \| undefined` | Optional | A civil entity within the address's `administrative_district_level_2`,
if any. | +| `postalCode` | `string \| null \| undefined` | Optional | 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` | [`string \| undefined`](../../doc/models/country.md) | Optional | 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). | +| `firstName` | `string \| null \| undefined` | Optional | Optional first name when it's representing recipient. | +| `lastName` | `string \| null \| undefined` | Optional | Optional last name when it's representing recipient. | + +## Example (as JSON) + +```json +{ + "address_line_1": "address_line_18", + "address_line_2": "address_line_28", + "address_line_3": "address_line_34", + "locality": "locality8", + "sublocality": "sublocality8" +} +``` + diff --git a/legacy/doc/models/adjust-loyalty-points-request.md b/legacy/doc/models/adjust-loyalty-points-request.md new file mode 100644 index 000000000..402941b6c --- /dev/null +++ b/legacy/doc/models/adjust-loyalty-points-request.md @@ -0,0 +1,31 @@ + +# Adjust Loyalty Points Request + +Represents an [AdjustLoyaltyPoints](../../doc/api/loyalty.md#adjust-loyalty-points) request. + +## Structure + +`AdjustLoyaltyPointsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string` | Required | A unique string that identifies this `AdjustLoyaltyPoints` request.
Keys can be any valid string, but must be unique for every request.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128` | +| `adjustPoints` | [`LoyaltyEventAdjustPoints`](../../doc/models/loyalty-event-adjust-points.md) | Required | Provides metadata when the event `type` is `ADJUST_POINTS`. | +| `allowNegativeBalance` | `boolean \| null \| undefined` | Optional | 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`. | + +## Example (as JSON) + +```json +{ + "adjust_points": { + "points": 10, + "reason": "Complimentary points", + "loyalty_program_id": "loyalty_program_id2" + }, + "idempotency_key": "bc29a517-3dc9-450e-aa76-fae39ee849d1", + "allow_negative_balance": false +} +``` + diff --git a/legacy/doc/models/adjust-loyalty-points-response.md b/legacy/doc/models/adjust-loyalty-points-response.md new file mode 100644 index 000000000..dd566fa19 --- /dev/null +++ b/legacy/doc/models/adjust-loyalty-points-response.md @@ -0,0 +1,63 @@ + +# Adjust Loyalty Points Response + +Represents an [AdjustLoyaltyPoints](../../doc/api/loyalty.md#adjust-loyalty-points) request. + +## Structure + +`AdjustLoyaltyPointsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `event` | [`LoyaltyEvent \| undefined`](../../doc/models/loyalty-event.md) | Optional | 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). | + +## Example (as JSON) + +```json +{ + "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", + "accumulate_points": { + "loyalty_program_id": "loyalty_program_id8", + "points": 118, + "order_id": "order_id8" + }, + "create_reward": { + "loyalty_program_id": "loyalty_program_id2", + "reward_id": "reward_id6", + "points": 90 + }, + "redeem_reward": { + "loyalty_program_id": "loyalty_program_id8", + "reward_id": "reward_id2", + "order_id": "order_id8" + }, + "delete_reward": { + "loyalty_program_id": "loyalty_program_id4", + "reward_id": "reward_id8", + "points": 104 + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/afterpay-details.md b/legacy/doc/models/afterpay-details.md new file mode 100644 index 000000000..e7e098585 --- /dev/null +++ b/legacy/doc/models/afterpay-details.md @@ -0,0 +1,23 @@ + +# Afterpay Details + +Additional details about Afterpay payments. + +## Structure + +`AfterpayDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `emailAddress` | `string \| null \| undefined` | Optional | Email address on the buyer's Afterpay account.
**Constraints**: *Maximum Length*: `255` | + +## Example (as JSON) + +```json +{ + "email_address": "email_address2" +} +``` + diff --git a/legacy/doc/models/application-details-external-square-product.md b/legacy/doc/models/application-details-external-square-product.md new file mode 100644 index 000000000..9fa8cdc37 --- /dev/null +++ b/legacy/doc/models/application-details-external-square-product.md @@ -0,0 +1,24 @@ + +# Application Details External Square Product + +A list of products to return to external callers. + +## Enumeration + +`ApplicationDetailsExternalSquareProduct` + +## Fields + +| Name | +| --- | +| `APPOINTMENTS` | +| `ECOMMERCE_API` | +| `INVOICES` | +| `ONLINE_STORE` | +| `OTHER` | +| `RESTAURANTS` | +| `RETAIL` | +| `SQUARE_POS` | +| `TERMINAL_API` | +| `VIRTUAL_TERMINAL` | + diff --git a/legacy/doc/models/application-details.md b/legacy/doc/models/application-details.md new file mode 100644 index 000000000..d4b01e742 --- /dev/null +++ b/legacy/doc/models/application-details.md @@ -0,0 +1,25 @@ + +# Application Details + +Details about the application that took the payment. + +## Structure + +`ApplicationDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `squareProduct` | [`string \| undefined`](../../doc/models/application-details-external-square-product.md) | Optional | A list of products to return to external callers. | +| `applicationId` | `string \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "square_product": "APPOINTMENTS", + "application_id": "application_id2" +} +``` + diff --git a/legacy/doc/models/application-type.md b/legacy/doc/models/application-type.md new file mode 100644 index 000000000..ab57c1f9b --- /dev/null +++ b/legacy/doc/models/application-type.md @@ -0,0 +1,13 @@ + +# Application Type + +## Enumeration + +`ApplicationType` + +## Fields + +| Name | +| --- | +| `TERMINAL_API` | + diff --git a/legacy/doc/models/appointment-segment.md b/legacy/doc/models/appointment-segment.md new file mode 100644 index 000000000..4327b9897 --- /dev/null +++ b/legacy/doc/models/appointment-segment.md @@ -0,0 +1,34 @@ + +# Appointment Segment + +Defines an appointment segment of a booking. + +## Structure + +`AppointmentSegment` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `durationMinutes` | `number \| null \| undefined` | Optional | The time span in minutes of an appointment segment.
**Constraints**: `<= 1500` | +| `serviceVariationId` | `string \| null \| undefined` | Optional | The ID of the [CatalogItemVariation](entity:CatalogItemVariation) object representing the service booked in this segment.
**Constraints**: *Maximum Length*: `36` | +| `teamMemberId` | `string` | Required | The ID of the [TeamMember](entity:TeamMember) object representing the team member booked in this segment.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `32` | +| `serviceVariationVersion` | `bigint \| null \| undefined` | Optional | The current version of the item variation representing the service booked in this segment. | +| `intermissionMinutes` | `number \| undefined` | Optional | Time between the end of this segment and the beginning of the subsequent segment. | +| `anyTeamMember` | `boolean \| undefined` | Optional | Whether the customer accepts any team member, instead of a specific one, to serve this segment. | +| `resourceIds` | `string[] \| undefined` | Optional | The IDs of the seller-accessible resources used for this appointment segment. | + +## Example (as JSON) + +```json +{ + "duration_minutes": 36, + "service_variation_id": "service_variation_id4", + "team_member_id": "team_member_id0", + "service_variation_version": 204, + "intermission_minutes": 210, + "any_team_member": false +} +``` + diff --git a/legacy/doc/models/archived-state.md b/legacy/doc/models/archived-state.md new file mode 100644 index 000000000..f9e985335 --- /dev/null +++ b/legacy/doc/models/archived-state.md @@ -0,0 +1,19 @@ + +# Archived State + +Defines the values for the `archived_state` query expression +used in [SearchCatalogItems](../../doc/api/catalog.md#search-catalog-items) +to return the archived, not archived or either type of catalog items. + +## Enumeration + +`ArchivedState` + +## Fields + +| Name | Description | +| --- | --- | +| `ARCHIVED_STATE_NOT_ARCHIVED` | Requested items are not archived with the `is_archived` attribute set to `false`. | +| `ARCHIVED_STATE_ARCHIVED` | Requested items are archived with the `is_archived` attribute set to `true`. | +| `ARCHIVED_STATE_ALL` | Requested items can be archived or not archived. | + diff --git a/legacy/doc/models/availability.md b/legacy/doc/models/availability.md new file mode 100644 index 000000000..5a66e78cc --- /dev/null +++ b/legacy/doc/models/availability.md @@ -0,0 +1,36 @@ + +# Availability + +Defines an appointment slot that encapsulates the appointment segments, location and starting time available for booking. + +## Structure + +`Availability` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `startAt` | `string \| null \| undefined` | Optional | The RFC 3339 timestamp specifying the beginning time of the slot available for booking. | +| `locationId` | `string \| undefined` | Optional | The ID of the location available for booking.
**Constraints**: *Maximum Length*: `32` | +| `appointmentSegments` | [`AppointmentSegment[] \| null \| undefined`](../../doc/models/appointment-segment.md) | Optional | The list of appointment segments available for booking | + +## Example (as JSON) + +```json +{ + "start_at": "start_at6", + "location_id": "location_id8", + "appointment_segments": [ + { + "duration_minutes": 136, + "service_variation_id": "service_variation_id4", + "team_member_id": "team_member_id0", + "service_variation_version": 48, + "intermission_minutes": 54, + "any_team_member": false + } + ] +} +``` + diff --git a/legacy/doc/models/bank-account-payment-details.md b/legacy/doc/models/bank-account-payment-details.md new file mode 100644 index 000000000..368eb8fea --- /dev/null +++ b/legacy/doc/models/bank-account-payment-details.md @@ -0,0 +1,34 @@ + +# Bank Account Payment Details + +Additional details about BANK_ACCOUNT type payments. + +## Structure + +`BankAccountPaymentDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `bankName` | `string \| null \| undefined` | Optional | The name of the bank associated with the bank account.
**Constraints**: *Maximum Length*: `100` | +| `transferType` | `string \| null \| undefined` | Optional | The type of the bank transfer. The type can be `ACH` or `UNKNOWN`.
**Constraints**: *Maximum Length*: `50` | +| `accountOwnershipType` | `string \| null \| undefined` | Optional | The ownership type of the bank account performing the transfer.
The type can be `INDIVIDUAL`, `COMPANY`, or `ACCOUNT_TYPE_UNKNOWN`.
**Constraints**: *Maximum Length*: `50` | +| `fingerprint` | `string \| null \| undefined` | Optional | Uniquely identifies the bank account for this seller and can be used
to determine if payments are from the same bank account.
**Constraints**: *Maximum Length*: `255` | +| `country` | `string \| null \| undefined` | Optional | The two-letter ISO code representing the country the bank account is located in.
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `2` | +| `statementDescription` | `string \| null \| undefined` | Optional | The statement description as sent to the bank.
**Constraints**: *Maximum Length*: `1000` | +| `achDetails` | [`ACHDetails \| undefined`](../../doc/models/ach-details.md) | Optional | ACH-specific details about `BANK_ACCOUNT` type payments with the `transfer_type` of `ACH`. | +| `errors` | [`Error[] \| null \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | + +## Example (as JSON) + +```json +{ + "bank_name": "bank_name4", + "transfer_type": "transfer_type8", + "account_ownership_type": "account_ownership_type8", + "fingerprint": "fingerprint6", + "country": "country4" +} +``` + diff --git a/legacy/doc/models/bank-account-status.md b/legacy/doc/models/bank-account-status.md new file mode 100644 index 000000000..7986f080b --- /dev/null +++ b/legacy/doc/models/bank-account-status.md @@ -0,0 +1,17 @@ + +# Bank Account Status + +Indicates the current verification status of a `BankAccount` object. + +## Enumeration + +`BankAccountStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `VERIFICATION_IN_PROGRESS` | Indicates that the verification process has started. Some features
(for example, creditable or debitable) may be provisionally enabled on the bank
account. | +| `VERIFIED` | Indicates that the bank account was successfully verified. | +| `DISABLED` | Indicates that the bank account is disabled and is permanently unusable
for funds transfer. A bank account can be disabled because of a failed verification
attempt or a failed deposit attempt. | + diff --git a/legacy/doc/models/bank-account-type.md b/legacy/doc/models/bank-account-type.md new file mode 100644 index 000000000..809c07a9c --- /dev/null +++ b/legacy/doc/models/bank-account-type.md @@ -0,0 +1,19 @@ + +# Bank Account Type + +Indicates the financial purpose of the bank account. + +## Enumeration + +`BankAccountType` + +## Fields + +| Name | Description | +| --- | --- | +| `CHECKING` | An account at a financial institution against which checks can be
drawn by the account depositor. | +| `SAVINGS` | An account at a financial institution that pays interest but cannot be
used directly as money in the narrow sense of a medium of exchange. | +| `INVESTMENT` | An account at a financial institution that contains a deposit of funds
and/or securities. | +| `OTHER` | An account at a financial institution which cannot be described by the
other types. | +| `BUSINESS_CHECKING` | An account at a financial institution against which checks can be
drawn specifically for business purposes (non-personal use). | + diff --git a/legacy/doc/models/bank-account.md b/legacy/doc/models/bank-account.md new file mode 100644 index 000000000..97584917f --- /dev/null +++ b/legacy/doc/models/bank-account.md @@ -0,0 +1,55 @@ + +# Bank Account + +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). + +## Structure + +`BankAccount` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string` | Required | The unique, Square-issued identifier for the bank account.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `30` | +| `accountNumberSuffix` | `string` | Required | The last few digits of the account number.
**Constraints**: *Minimum Length*: `1` | +| `country` | [`string`](../../doc/models/country.md) | Required | 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). | +| `currency` | [`string`](../../doc/models/currency.md) | Required | Indicates the associated currency for an amount of money. Values correspond
to [ISO 4217](https://wikipedia.org/wiki/ISO_4217). | +| `accountType` | [`string`](../../doc/models/bank-account-type.md) | Required | Indicates the financial purpose of the bank account. | +| `holderName` | `string` | Required | Name of the account holder. This name must match the name
on the targeted bank account record.
**Constraints**: *Minimum Length*: `1` | +| `primaryBankIdentificationNumber` | `string` | Required | Primary identifier for the bank. For more information, see
[Bank Accounts API](https://developer.squareup.com/docs/bank-accounts-api).
**Constraints**: *Maximum Length*: `40` | +| `secondaryBankIdentificationNumber` | `string \| null \| undefined` | Optional | Secondary identifier for the bank. For more information, see
[Bank Accounts API](https://developer.squareup.com/docs/bank-accounts-api).
**Constraints**: *Maximum Length*: `40` | +| `debitMandateReferenceId` | `string \| null \| undefined` | Optional | Reference identifier that will be displayed to UK bank account owners
when collecting direct debit authorization. Only required for UK bank accounts. | +| `referenceId` | `string \| null \| undefined` | Optional | 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). | +| `locationId` | `string \| null \| undefined` | Optional | The location to which the bank account belongs. | +| `status` | [`string`](../../doc/models/bank-account-status.md) | Required | Indicates the current verification status of a `BankAccount` object. | +| `creditable` | `boolean` | Required | Indicates whether it is possible for Square to send money to this bank account. | +| `debitable` | `boolean` | Required | Indicates whether it is possible for Square to take money from this
bank account. | +| `fingerprint` | `string \| null \| undefined` | Optional | 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` | `number \| undefined` | Optional | The current version of the `BankAccount`. | +| `bankName` | `string \| null \| undefined` | Optional | Read only. Name of actual financial institution.
For example "Bank of America".
**Constraints**: *Maximum Length*: `100` | + +## Example (as JSON) + +```json +{ + "id": "id2", + "account_number_suffix": "account_number_suffix6", + "country": "TT", + "currency": "MVR", + "account_type": "OTHER", + "holder_name": "holder_name8", + "primary_bank_identification_number": "primary_bank_identification_number0", + "secondary_bank_identification_number": "secondary_bank_identification_number2", + "debit_mandate_reference_id": "debit_mandate_reference_id2", + "reference_id": "reference_id0", + "location_id": "location_id6", + "status": "VERIFICATION_IN_PROGRESS", + "creditable": false, + "debitable": false, + "fingerprint": "fingerprint8" +} +``` + diff --git a/legacy/doc/models/batch-change-inventory-request.md b/legacy/doc/models/batch-change-inventory-request.md new file mode 100644 index 000000000..fff4a91b9 --- /dev/null +++ b/legacy/doc/models/batch-change-inventory-request.md @@ -0,0 +1,67 @@ + +# Batch Change Inventory Request + +## Structure + +`BatchChangeInventoryRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string` | Required | 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.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128` | +| `changes` | [`InventoryChange[] \| null \| undefined`](../../doc/models/inventory-change.md) | Optional | 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. | +| `ignoreUnchangedCounts` | `boolean \| null \| undefined` | Optional | Indicates whether the current physical count should be ignored if
the quantity is unchanged since the last physical count. Default: `true`. | + +## Example (as JSON) + +```json +{ + "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", + "id": "id2", + "catalog_object_type": "catalog_object_type6" + }, + "type": "PHYSICAL_COUNT", + "adjustment": { + "id": "id4", + "reference_id": "reference_id2", + "from_state": "IN_TRANSIT_TO", + "to_state": "SOLD", + "location_id": "location_id8" + }, + "transfer": { + "id": "id8", + "reference_id": "reference_id6", + "state": "RESERVED_FOR_SALE", + "from_location_id": "from_location_id0", + "to_location_id": "to_location_id0" + }, + "measurement_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 184 + } + } + ], + "idempotency_key": "8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe", + "ignore_unchanged_counts": true +} +``` + diff --git a/legacy/doc/models/batch-change-inventory-response.md b/legacy/doc/models/batch-change-inventory-response.md new file mode 100644 index 000000000..ecd3fa0a0 --- /dev/null +++ b/legacy/doc/models/batch-change-inventory-response.md @@ -0,0 +1,72 @@ + +# Batch Change Inventory Response + +## Structure + +`BatchChangeInventoryResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `counts` | [`InventoryCount[] \| undefined`](../../doc/models/inventory-count.md) | Optional | The current counts for all objects referenced in the request. | +| `changes` | [`InventoryChange[] \| undefined`](../../doc/models/inventory-change.md) | Optional | Changes created for the request. | + +## Example (as JSON) + +```json +{ + "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": [], + "changes": [ + { + "type": "TRANSFER", + "physical_count": { + "id": "id2", + "reference_id": "reference_id0", + "catalog_object_id": "catalog_object_id6", + "catalog_object_type": "catalog_object_type6", + "state": "SUPPORTED_BY_NEWER_VERSION" + }, + "adjustment": { + "id": "id4", + "reference_id": "reference_id2", + "from_state": "IN_TRANSIT_TO", + "to_state": "SOLD", + "location_id": "location_id8" + }, + "transfer": { + "id": "id8", + "reference_id": "reference_id6", + "state": "RESERVED_FOR_SALE", + "from_location_id": "from_location_id0", + "to_location_id": "to_location_id0" + }, + "measurement_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 184 + } + } + ] +} +``` + diff --git a/legacy/doc/models/batch-delete-catalog-objects-request.md b/legacy/doc/models/batch-delete-catalog-objects-request.md new file mode 100644 index 000000000..359ef0655 --- /dev/null +++ b/legacy/doc/models/batch-delete-catalog-objects-request.md @@ -0,0 +1,24 @@ + +# Batch Delete Catalog Objects Request + +## Structure + +`BatchDeleteCatalogObjectsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `objectIds` | `string[] \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "object_ids": [ + "W62UWFY35CWMYGVWK6TWJDNI", + "AA27W3M2GGTF3H6AVPNB77CK" + ] +} +``` + diff --git a/legacy/doc/models/batch-delete-catalog-objects-response.md b/legacy/doc/models/batch-delete-catalog-objects-response.md new file mode 100644 index 000000000..f4368f645 --- /dev/null +++ b/legacy/doc/models/batch-delete-catalog-objects-response.md @@ -0,0 +1,35 @@ + +# Batch Delete Catalog Objects Response + +## Structure + +`BatchDeleteCatalogObjectsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `deletedObjectIds` | `string[] \| undefined` | Optional | The IDs of all CatalogObjects deleted by this request. | +| `deletedAt` | `string \| undefined` | Optional | 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 (as JSON) + +```json +{ + "deleted_at": "2016-11-16T22:25:24.878Z", + "deleted_object_ids": [ + "W62UWFY35CWMYGVWK6TWJDNI", + "AA27W3M2GGTF3H6AVPNB77CK" + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/batch-retrieve-catalog-objects-request.md b/legacy/doc/models/batch-retrieve-catalog-objects-request.md new file mode 100644 index 000000000..e68862f2b --- /dev/null +++ b/legacy/doc/models/batch-retrieve-catalog-objects-request.md @@ -0,0 +1,32 @@ + +# Batch Retrieve Catalog Objects Request + +## Structure + +`BatchRetrieveCatalogObjectsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `objectIds` | `string[]` | Required | The IDs of the CatalogObjects to be retrieved. | +| `includeRelatedObjects` | `boolean \| null \| undefined` | Optional | 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` | +| `catalogVersion` | `bigint \| null \| undefined` | Optional | 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](../../doc/models/catalog-object.md)s' `version` attribute. If not included, results will
be from the current version of the catalog. | +| `includeDeletedObjects` | `boolean \| null \| undefined` | Optional | Indicates whether to include (`true`) or not (`false`) in the response deleted objects, namely, those with the `is_deleted` attribute set to `true`. | +| `includeCategoryPathToRoot` | `boolean \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "include_related_objects": true, + "object_ids": [ + "W62UWFY35CWMYGVWK6TWJDNI", + "AA27W3M2GGTF3H6AVPNB77CK" + ], + "catalog_version": 190, + "include_deleted_objects": false, + "include_category_path_to_root": false +} +``` + diff --git a/legacy/doc/models/batch-retrieve-catalog-objects-response.md b/legacy/doc/models/batch-retrieve-catalog-objects-response.md new file mode 100644 index 000000000..693c41867 --- /dev/null +++ b/legacy/doc/models/batch-retrieve-catalog-objects-response.md @@ -0,0 +1,276 @@ + +# Batch Retrieve Catalog Objects Response + +## Structure + +`BatchRetrieveCatalogObjectsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `objects` | [`CatalogObject[] \| undefined`](../../doc/models/catalog-object.md) | Optional | A list of [CatalogObject](entity:CatalogObject)s returned. | +| `relatedObjects` | [`CatalogObject[] \| undefined`](../../doc/models/catalog-object.md) | Optional | A list of [CatalogObject](entity:CatalogObject)s referenced by the object in the `objects` field. | + +## Example (as JSON) + +```json +{ + "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, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] + }, + { + "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, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] + } + ], + "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, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] + }, + { + "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, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/batch-retrieve-inventory-changes-request.md b/legacy/doc/models/batch-retrieve-inventory-changes-request.md new file mode 100644 index 000000000..0f9f75c84 --- /dev/null +++ b/legacy/doc/models/batch-retrieve-inventory-changes-request.md @@ -0,0 +1,41 @@ + +# Batch Retrieve Inventory Changes Request + +## Structure + +`BatchRetrieveInventoryChangesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `catalogObjectIds` | `string[] \| null \| undefined` | Optional | The filter to return results by `CatalogObject` ID.
The filter is only applicable when set. The default value is null. | +| `locationIds` | `string[] \| null \| undefined` | Optional | The filter to return results by `Location` ID.
The filter is only applicable when set. The default value is null. | +| `types` | [`string[] \| null \| undefined`](../../doc/models/inventory-change-type.md) | Optional | The filter to return results by `InventoryChangeType` values other than `TRANSFER`.
The default value is `[PHYSICAL_COUNT, ADJUSTMENT]`. | +| `states` | [`string[] \| null \| undefined`](../../doc/models/inventory-state.md) | Optional | The filter to return `ADJUSTMENT` query results by
`InventoryState`. This filter is only applied when set.
The default value is null. | +| `updatedAfter` | `string \| null \| undefined` | Optional | 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`). | +| `updatedBefore` | `string \| null \| undefined` | Optional | 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` | `string \| null \| undefined` | Optional | 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` | `number \| null \| undefined` | Optional | The number of [records](entity:InventoryChange) to return.
**Constraints**: `>= 1`, `<= 1000` | + +## Example (as JSON) + +```json +{ + "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" +} +``` + diff --git a/legacy/doc/models/batch-retrieve-inventory-changes-response.md b/legacy/doc/models/batch-retrieve-inventory-changes-response.md new file mode 100644 index 000000000..f3c8283cd --- /dev/null +++ b/legacy/doc/models/batch-retrieve-inventory-changes-response.md @@ -0,0 +1,73 @@ + +# Batch Retrieve Inventory Changes Response + +## Structure + +`BatchRetrieveInventoryChangesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `changes` | [`InventoryChange[] \| undefined`](../../doc/models/inventory-change.md) | Optional | The current calculated inventory changes for the requested objects
and locations. | +| `cursor` | `string \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "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", + "adjustment": { + "id": "id4", + "reference_id": "reference_id2", + "from_state": "IN_TRANSIT_TO", + "to_state": "SOLD", + "location_id": "location_id8" + }, + "transfer": { + "id": "id8", + "reference_id": "reference_id6", + "state": "RESERVED_FOR_SALE", + "from_location_id": "from_location_id0", + "to_location_id": "to_location_id0" + }, + "measurement_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 184 + } + } + ], + "errors": [], + "cursor": "cursor2" +} +``` + diff --git a/legacy/doc/models/batch-retrieve-inventory-counts-request.md b/legacy/doc/models/batch-retrieve-inventory-counts-request.md new file mode 100644 index 000000000..abc52c79a --- /dev/null +++ b/legacy/doc/models/batch-retrieve-inventory-counts-request.md @@ -0,0 +1,37 @@ + +# Batch Retrieve Inventory Counts Request + +## Structure + +`BatchRetrieveInventoryCountsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `catalogObjectIds` | `string[] \| null \| undefined` | Optional | The filter to return results by `CatalogObject` ID.
The filter is applicable only when set. The default is null. | +| `locationIds` | `string[] \| null \| undefined` | Optional | The filter to return results by `Location` ID.
This filter is applicable only when set. The default is null. | +| `updatedAfter` | `string \| null \| undefined` | Optional | 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` | `string \| null \| undefined` | Optional | 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` | [`string[] \| null \| undefined`](../../doc/models/inventory-state.md) | Optional | 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` | `number \| null \| undefined` | Optional | The number of [records](entity:InventoryCount) to return.
**Constraints**: `>= 1`, `<= 1000` | + +## Example (as JSON) + +```json +{ + "catalog_object_ids": [ + "W62UWFY35CWMYGVWK6TWJDNI" + ], + "location_ids": [ + "59TNP9SA8VGDA" + ], + "updated_after": "2016-11-16T00:00:00.000Z", + "cursor": "cursor2", + "states": [ + "RESERVED_FOR_SALE", + "RETURNED_BY_CUSTOMER" + ] +} +``` + diff --git a/legacy/doc/models/batch-retrieve-inventory-counts-response.md b/legacy/doc/models/batch-retrieve-inventory-counts-response.md new file mode 100644 index 000000000..a70116058 --- /dev/null +++ b/legacy/doc/models/batch-retrieve-inventory-counts-response.md @@ -0,0 +1,34 @@ + +# Batch Retrieve Inventory Counts Response + +## Structure + +`BatchRetrieveInventoryCountsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `counts` | [`InventoryCount[] \| undefined`](../../doc/models/inventory-count.md) | Optional | The current calculated inventory counts for the requested objects
and locations. | +| `cursor` | `string \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "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": [], + "cursor": "cursor8" +} +``` + diff --git a/legacy/doc/models/batch-retrieve-orders-request.md b/legacy/doc/models/batch-retrieve-orders-request.md new file mode 100644 index 000000000..76f619149 --- /dev/null +++ b/legacy/doc/models/batch-retrieve-orders-request.md @@ -0,0 +1,29 @@ + +# Batch Retrieve Orders Request + +Defines the fields that are included in requests to the +`BatchRetrieveOrders` endpoint. + +## Structure + +`BatchRetrieveOrdersRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string \| null \| undefined` | Optional | 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. | +| `orderIds` | `string[]` | Required | The IDs of the orders to retrieve. A maximum of 100 orders can be retrieved per request. | + +## Example (as JSON) + +```json +{ + "location_id": "057P5VYJ4A5X1", + "order_ids": [ + "CAISEM82RcpmcFBM0TfOyiHV3es", + "CAISENgvlJ6jLWAzERDzjyHVybY" + ] +} +``` + diff --git a/legacy/doc/models/batch-retrieve-orders-response.md b/legacy/doc/models/batch-retrieve-orders-response.md new file mode 100644 index 000000000..d5693842d --- /dev/null +++ b/legacy/doc/models/batch-retrieve-orders-response.md @@ -0,0 +1,121 @@ + +# Batch Retrieve Orders Response + +Defines the fields that are included in the response body of +a request to the `BatchRetrieveOrders` endpoint. + +## Structure + +`BatchRetrieveOrdersResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `orders` | [`Order[] \| undefined`](../../doc/models/order.md) | Optional | The requested orders. This will omit any requested orders that do not exist. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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", + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note4", + "catalog_object_id": "catalog_object_id2" + }, + { + "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", + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note4", + "catalog_object_id": "catalog_object_id2" + } + ], + "location_id": "057P5VYJ4A5X1", + "reference_id": "my-order-001", + "total_money": { + "amount": 7599, + "currency": "USD" + }, + "source": { + "name": "name4" + }, + "customer_id": "customer_id0" + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/batch-upsert-catalog-objects-request.md b/legacy/doc/models/batch-upsert-catalog-objects-request.md new file mode 100644 index 000000000..069f4a63c --- /dev/null +++ b/legacy/doc/models/batch-upsert-catalog-objects-request.md @@ -0,0 +1,261 @@ + +# Batch Upsert Catalog Objects Request + +## Structure + +`BatchUpsertCatalogObjectsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string` | Required | 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.
**Constraints**: *Minimum Length*: `1` | +| `batches` | [`CatalogObjectBatch[]`](../../doc/models/catalog-object-batch.md) | Required | 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. | + +## Example (as JSON) + +```json +{ + "batches": [ + { + "objects": [ + { + "id": "#Tea", + "item_data": { + "categories": [ + { + "id": "#Beverages" + } + ], + "description_html": "

Hot Leaf Juice

", + "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", + "updated_at": "updated_at2", + "version": 164, + "is_deleted": false, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] + }, + { + "id": "#Coffee", + "item_data": { + "categories": [ + { + "id": "#Beverages" + } + ], + "description_html": "

Hot Bean Juice

", + "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", + "updated_at": "updated_at2", + "version": 164, + "is_deleted": false, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] + }, + { + "category_data": { + "name": "Beverages" + }, + "id": "#Beverages", + "present_at_all_locations": true, + "type": "CATEGORY", + "updated_at": "updated_at2", + "version": 164, + "is_deleted": false, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] + }, + { + "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", + "updated_at": "updated_at2", + "version": 164, + "is_deleted": false, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] + } + ] + } + ], + "idempotency_key": "789ff020-f723-43a9-b4b5-43b5dc1fa3dc" +} +``` + diff --git a/legacy/doc/models/batch-upsert-catalog-objects-response.md b/legacy/doc/models/batch-upsert-catalog-objects-response.md new file mode 100644 index 000000000..0337d30f5 --- /dev/null +++ b/legacy/doc/models/batch-upsert-catalog-objects-response.md @@ -0,0 +1,340 @@ + +# Batch Upsert Catalog Objects Response + +## Structure + +`BatchUpsertCatalogObjectsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `objects` | [`CatalogObject[] \| undefined`](../../doc/models/catalog-object.md) | Optional | The created successfully created CatalogObjects. | +| `updatedAt` | `string \| undefined` | Optional | 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". | +| `idMappings` | [`CatalogIdMapping[] \| undefined`](../../doc/models/catalog-id-mapping.md) | Optional | The mapping between client and server IDs for this upsert. | + +## Example (as JSON) + +```json +{ + "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": "

Hot Leaf Juice

", + "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, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] + }, + { + "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": "

Hot Bean Juice

", + "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, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] + }, + { + "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, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] + }, + { + "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, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "updated_at": "updated_at6" +} +``` + diff --git a/legacy/doc/models/booking-booking-source.md b/legacy/doc/models/booking-booking-source.md new file mode 100644 index 000000000..38440cafb --- /dev/null +++ b/legacy/doc/models/booking-booking-source.md @@ -0,0 +1,18 @@ + +# Booking Booking Source + +Supported sources a booking was created from. + +## Enumeration + +`BookingBookingSource` + +## Fields + +| Name | Description | +| --- | --- | +| `FIRST_PARTY_MERCHANT` | The booking was created by a seller from a Square Appointments application, such as the Square Appointments Dashboard or a Square Appointments mobile app. | +| `FIRST_PARTY_BUYER` | The booking was created by a buyer from a Square Appointments application, such as Square Online Booking Site. | +| `THIRD_PARTY_BUYER` | The booking was created by a buyer created from a third-party application. | +| `API` | The booking was created by a seller or a buyer from the Square Bookings API. | + diff --git a/legacy/doc/models/booking-creator-details-creator-type.md b/legacy/doc/models/booking-creator-details-creator-type.md new file mode 100644 index 000000000..1e8c073f8 --- /dev/null +++ b/legacy/doc/models/booking-creator-details-creator-type.md @@ -0,0 +1,16 @@ + +# Booking Creator Details Creator Type + +Supported types of a booking creator. + +## Enumeration + +`BookingCreatorDetailsCreatorType` + +## Fields + +| Name | Description | +| --- | --- | +| `TEAM_MEMBER` | The creator is of the seller type. | +| `CUSTOMER` | The creator is of the buyer type. | + diff --git a/legacy/doc/models/booking-creator-details.md b/legacy/doc/models/booking-creator-details.md new file mode 100644 index 000000000..7e0bbb586 --- /dev/null +++ b/legacy/doc/models/booking-creator-details.md @@ -0,0 +1,27 @@ + +# Booking Creator Details + +Information about a booking creator. + +## Structure + +`BookingCreatorDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `creatorType` | [`string \| undefined`](../../doc/models/booking-creator-details-creator-type.md) | Optional | Supported types of a booking creator. | +| `teamMemberId` | `string \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `32` | +| `customerId` | `string \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `192` | + +## Example (as JSON) + +```json +{ + "creator_type": "TEAM_MEMBER", + "team_member_id": "team_member_id4", + "customer_id": "customer_id2" +} +``` + diff --git a/legacy/doc/models/booking-custom-attribute-delete-request.md b/legacy/doc/models/booking-custom-attribute-delete-request.md new file mode 100644 index 000000000..b2c94264f --- /dev/null +++ b/legacy/doc/models/booking-custom-attribute-delete-request.md @@ -0,0 +1,26 @@ + +# Booking Custom Attribute Delete Request + +Represents an individual delete request in a [BulkDeleteBookingCustomAttributes](../../doc/api/booking-custom-attributes.md#bulk-delete-booking-custom-attributes) +request. An individual request contains a booking ID, the custom attribute to delete, and an optional idempotency key. + +## Structure + +`BookingCustomAttributeDeleteRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `bookingId` | `string` | Required | The ID of the target [booking](entity:Booking).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | +| `key` | `string` | Required | 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.
**Constraints**: *Minimum Length*: `1` | + +## Example (as JSON) + +```json +{ + "booking_id": "booking_id0", + "key": "key6" +} +``` + diff --git a/legacy/doc/models/booking-custom-attribute-delete-response.md b/legacy/doc/models/booking-custom-attribute-delete-response.md new file mode 100644 index 000000000..e89103154 --- /dev/null +++ b/legacy/doc/models/booking-custom-attribute-delete-response.md @@ -0,0 +1,25 @@ + +# Booking Custom Attribute Delete Response + +Represents a response for an individual upsert request in a [BulkDeleteBookingCustomAttributes](../../doc/api/booking-custom-attributes.md#bulk-delete-booking-custom-attributes) operation. + +## Structure + +`BookingCustomAttributeDeleteResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `bookingId` | `string \| undefined` | Optional | The ID of the [booking](entity:Booking) associated with the custom attribute. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred while processing the individual request. | + +## Example (as JSON) + +```json +{ + "booking_id": "N3NCVYY3WS27HF0HKANA3R9FP8", + "errors": [] +} +``` + diff --git a/legacy/doc/models/booking-custom-attribute-upsert-request.md b/legacy/doc/models/booking-custom-attribute-upsert-request.md new file mode 100644 index 000000000..5caa73227 --- /dev/null +++ b/legacy/doc/models/booking-custom-attribute-upsert-request.md @@ -0,0 +1,47 @@ + +# Booking Custom Attribute Upsert Request + +Represents an individual upsert request in a [BulkUpsertBookingCustomAttributes](../../doc/api/booking-custom-attributes.md#bulk-upsert-booking-custom-attributes) +request. An individual request contains a booking ID, the custom attribute to create or update, +and an optional idempotency key. + +## Structure + +`BookingCustomAttributeUpsertRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `bookingId` | `string` | Required | The ID of the target [booking](entity:Booking).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | +| `customAttribute` | [`CustomAttribute`](../../doc/models/custom-attribute.md) | Required | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | +| `idempotencyKey` | `string \| null \| undefined` | Optional | 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).
**Constraints**: *Maximum Length*: `45` | + +## Example (as JSON) + +```json +{ + "booking_id": "booking_id2", + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "idempotency_key": "idempotency_key4" +} +``` + diff --git a/legacy/doc/models/booking-custom-attribute-upsert-response.md b/legacy/doc/models/booking-custom-attribute-upsert-response.md new file mode 100644 index 000000000..b43d49209 --- /dev/null +++ b/legacy/doc/models/booking-custom-attribute-upsert-response.md @@ -0,0 +1,64 @@ + +# Booking Custom Attribute Upsert Response + +Represents a response for an individual upsert request in a [BulkUpsertBookingCustomAttributes](../../doc/api/booking-custom-attributes.md#bulk-upsert-booking-custom-attributes) operation. + +## Structure + +`BookingCustomAttributeUpsertResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `bookingId` | `string \| undefined` | Optional | The ID of the [booking](entity:Booking) associated with the custom attribute. | +| `customAttribute` | [`CustomAttribute \| undefined`](../../doc/models/custom-attribute.md) | Optional | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred while processing the individual request. | + +## Example (as JSON) + +```json +{ + "booking_id": "booking_id6", + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/booking-status.md b/legacy/doc/models/booking-status.md new file mode 100644 index 000000000..3673283e8 --- /dev/null +++ b/legacy/doc/models/booking-status.md @@ -0,0 +1,20 @@ + +# Booking Status + +Supported booking statuses. + +## Enumeration + +`BookingStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `PENDING` | An unaccepted booking. It is visible to both sellers and customers. | +| `CANCELLED_BY_CUSTOMER` | A customer-cancelled booking. It is visible to both the seller and the customer. | +| `CANCELLED_BY_SELLER` | A seller-cancelled booking. It is visible to both the seller and the customer. | +| `DECLINED` | A declined booking. It had once been pending, but was then declined by the seller. | +| `ACCEPTED` | An accepted booking agreed to or accepted by the seller. | +| `NO_SHOW` | A no-show booking. The booking was accepted at one time, but have now been marked as a no-show by
the seller because the client either missed the booking or cancelled it without enough notice. | + diff --git a/legacy/doc/models/booking.md b/legacy/doc/models/booking.md new file mode 100644 index 000000000..8b1a96f46 --- /dev/null +++ b/legacy/doc/models/booking.md @@ -0,0 +1,44 @@ + +# Booking + +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. + +## Structure + +`Booking` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | A unique ID of this object representing a booking.
**Constraints**: *Maximum Length*: `36` | +| `version` | `number \| undefined` | Optional | The revision number for the booking used for optimistic concurrency. | +| `status` | [`string \| undefined`](../../doc/models/booking-status.md) | Optional | Supported booking statuses. | +| `createdAt` | `string \| undefined` | Optional | The RFC 3339 timestamp specifying the creation time of this booking. | +| `updatedAt` | `string \| undefined` | Optional | The RFC 3339 timestamp specifying the most recent update time of this booking. | +| `startAt` | `string \| null \| undefined` | Optional | The RFC 3339 timestamp specifying the starting time of this booking. | +| `locationId` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `32` | +| `customerId` | `string \| null \| undefined` | Optional | The ID of the [Customer](entity:Customer) object representing the customer receiving the booked service.
**Constraints**: *Maximum Length*: `192` | +| `customerNote` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `4096` | +| `sellerNote` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `4096` | +| `appointmentSegments` | [`AppointmentSegment[] \| null \| undefined`](../../doc/models/appointment-segment.md) | Optional | A list of appointment segments for this booking. | +| `transitionTimeMinutes` | `number \| undefined` | Optional | Additional time at the end of a booking.
Applications should not make this field visible to customers of a seller. | +| `allDay` | `boolean \| undefined` | Optional | Whether the booking is of a full business day. | +| `locationType` | [`string \| undefined`](../../doc/models/business-appointment-settings-booking-location-type.md) | Optional | Supported types of location where service is provided. | +| `creatorDetails` | [`BookingCreatorDetails \| undefined`](../../doc/models/booking-creator-details.md) | Optional | Information about a booking creator. | +| `source` | [`string \| undefined`](../../doc/models/booking-booking-source.md) | Optional | Supported sources a booking was created from. | +| `address` | [`Address \| undefined`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | + +## Example (as JSON) + +```json +{ + "id": "id4", + "version": 92, + "status": "PENDING", + "created_at": "created_at2", + "updated_at": "updated_at0" +} +``` + diff --git a/legacy/doc/models/break-type.md b/legacy/doc/models/break-type.md new file mode 100644 index 000000000..387b97cfa --- /dev/null +++ b/legacy/doc/models/break-type.md @@ -0,0 +1,38 @@ + +# Break Type + +A defined break template that sets an expectation for possible `Break` +instances on a `Shift`. + +## Structure + +`BreakType` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | The UUID for this object.
**Constraints**: *Maximum Length*: `255` | +| `locationId` | `string` | Required | The ID of the business location this type of break applies to.
**Constraints**: *Minimum Length*: `1` | +| `breakName` | `string` | Required | A human-readable name for this type of break. The name is displayed to
employees in Square products.
**Constraints**: *Minimum Length*: `1` | +| `expectedDuration` | `string` | Required | 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: T15M
**Constraints**: *Minimum Length*: `1` | +| `isPaid` | `boolean` | Required | Whether this break counts towards time worked for compensation
purposes. | +| `version` | `number \| undefined` | Optional | 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. | +| `createdAt` | `string \| undefined` | Optional | A read-only timestamp in RFC 3339 format. | +| `updatedAt` | `string \| undefined` | Optional | A read-only timestamp in RFC 3339 format. | + +## Example (as JSON) + +```json +{ + "id": "id4", + "location_id": "location_id8", + "break_name": "break_name4", + "expected_duration": "expected_duration0", + "is_paid": false, + "version": 236, + "created_at": "created_at8", + "updated_at": "updated_at0" +} +``` + diff --git a/legacy/doc/models/break.md b/legacy/doc/models/break.md new file mode 100644 index 000000000..aca71b0c5 --- /dev/null +++ b/legacy/doc/models/break.md @@ -0,0 +1,35 @@ + +# Break + +A record of an employee's break during a shift. + +## Structure + +`Break` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | The UUID for this object. | +| `startAt` | `string` | Required | RFC 3339; follows the same timezone information as `Shift`. Precision up to
the minute is respected; seconds are truncated.
**Constraints**: *Minimum Length*: `1` | +| `endAt` | `string \| null \| undefined` | Optional | RFC 3339; follows the same timezone information as `Shift`. Precision up to
the minute is respected; seconds are truncated. | +| `breakTypeId` | `string` | Required | The `BreakType` that this `Break` was templated on.
**Constraints**: *Minimum Length*: `1` | +| `name` | `string` | Required | A human-readable name.
**Constraints**: *Minimum Length*: `1` | +| `expectedDuration` | `string` | Required | Format: RFC-3339 P[n]Y[n]M[n]DT[n]H[n]M[n]S. The expected length of
the break.
**Constraints**: *Minimum Length*: `1` | +| `isPaid` | `boolean` | Required | Whether this break counts towards time worked for compensation
purposes. | + +## Example (as JSON) + +```json +{ + "id": "id6", + "start_at": "start_at8", + "end_at": "end_at4", + "break_type_id": "break_type_id2", + "name": "name6", + "expected_duration": "expected_duration8", + "is_paid": false +} +``` + diff --git a/legacy/doc/models/bulk-create-customer-data.md b/legacy/doc/models/bulk-create-customer-data.md new file mode 100644 index 000000000..60e0e1ff4 --- /dev/null +++ b/legacy/doc/models/bulk-create-customer-data.md @@ -0,0 +1,38 @@ + +# Bulk Create Customer Data + +Defines the customer data provided in individual create requests for a +[BulkCreateCustomers](../../doc/api/customers.md#bulk-create-customers) operation. + +## Structure + +`BulkCreateCustomerData` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `givenName` | `string \| null \| undefined` | Optional | The given name (that is, the first name) associated with the customer profile.
**Constraints**: *Maximum Length*: `300` | +| `familyName` | `string \| null \| undefined` | Optional | The family name (that is, the last name) associated with the customer profile.
**Constraints**: *Maximum Length*: `300` | +| `companyName` | `string \| null \| undefined` | Optional | A business name associated with the customer profile.
**Constraints**: *Maximum Length*: `500` | +| `nickname` | `string \| null \| undefined` | Optional | A nickname for the customer profile.
**Constraints**: *Maximum Length*: `100` | +| `emailAddress` | `string \| null \| undefined` | Optional | The email address associated with the customer profile.
**Constraints**: *Maximum Length*: `254` | +| `address` | [`Address \| undefined`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | +| `phoneNumber` | `string \| null \| undefined` | Optional | 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). | +| `referenceId` | `string \| null \| undefined` | Optional | An optional second ID used to associate the customer profile with an
entity in another system.
**Constraints**: *Maximum Length*: `100` | +| `note` | `string \| null \| undefined` | Optional | A custom note associated with the customer profile. | +| `birthday` | `string \| null \| undefined` | Optional | 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. | +| `taxIds` | [`CustomerTaxIds \| undefined`](../../doc/models/customer-tax-ids.md) | Optional | Represents the tax ID associated with a [customer profile](../../doc/models/customer.md). 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). | + +## Example (as JSON) + +```json +{ + "given_name": "given_name4", + "family_name": "family_name4", + "company_name": "company_name8", + "nickname": "nickname8", + "email_address": "email_address0" +} +``` + diff --git a/legacy/doc/models/bulk-create-customers-request.md b/legacy/doc/models/bulk-create-customers-request.md new file mode 100644 index 000000000..a46c27240 --- /dev/null +++ b/legacy/doc/models/bulk-create-customers-request.md @@ -0,0 +1,61 @@ + +# Bulk Create Customers Request + +Defines the body parameters that can be included in requests to the +[BulkCreateCustomers](../../doc/api/customers.md#bulk-create-customers) endpoint. + +## Structure + +`BulkCreateCustomersRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customers` | [`Record`](../../doc/models/bulk-create-customer-data.md) | Required | 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. | + +## Example (as JSON) + +```json +{ + "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", + "company_name": "company_name8", + "nickname": "nickname8" + }, + "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", + "company_name": "company_name8", + "nickname": "nickname8" + } + } +} +``` + diff --git a/legacy/doc/models/bulk-create-customers-response.md b/legacy/doc/models/bulk-create-customers-response.md new file mode 100644 index 000000000..304433ffa --- /dev/null +++ b/legacy/doc/models/bulk-create-customers-response.md @@ -0,0 +1,150 @@ + +# Bulk Create Customers Response + +Defines the fields included in the response body from the +[BulkCreateCustomers](../../doc/api/customers.md#bulk-create-customers) endpoint. + +## Structure + +`BulkCreateCustomersResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `responses` | [`Record \| undefined`](../../doc/models/create-customer-response.md) | Optional | 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` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any top-level errors that prevented the bulk operation from running. | + +## Example (as JSON) + +```json +{ + "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, + "cards": [ + { + "id": "id8", + "card_brand": "DISCOVER", + "last_4": "last_40", + "exp_month": 152, + "exp_year": 144 + } + ] + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] + }, + "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, + "cards": [ + { + "id": "id8", + "card_brand": "DISCOVER", + "last_4": "last_40", + "exp_month": 152, + "exp_year": 144 + } + ] + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/bulk-create-team-members-request.md b/legacy/doc/models/bulk-create-team-members-request.md new file mode 100644 index 000000000..3756bd72b --- /dev/null +++ b/legacy/doc/models/bulk-create-team-members-request.md @@ -0,0 +1,60 @@ + +# Bulk Create Team Members Request + +Represents a bulk create request for `TeamMember` objects. + +## Structure + +`BulkCreateTeamMembersRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `teamMembers` | [`Record`](../../doc/models/create-team-member-request.md) | Required | 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). | + +## Example (as JSON) + +```json +{ + "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", + "id": "id6", + "is_owner": false, + "status": "ACTIVE" + }, + "idempotency_key": "idempotency_key4" + }, + "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", + "id": "id6", + "is_owner": false, + "status": "ACTIVE" + }, + "idempotency_key": "idempotency_key4" + } + } +} +``` + diff --git a/legacy/doc/models/bulk-create-team-members-response.md b/legacy/doc/models/bulk-create-team-members-response.md new file mode 100644 index 000000000..be00eadc8 --- /dev/null +++ b/legacy/doc/models/bulk-create-team-members-response.md @@ -0,0 +1,95 @@ + +# Bulk Create Team Members Response + +Represents a response from a bulk create request containing the created `TeamMember` objects or error messages. + +## Structure + +`BulkCreateTeamMembersResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `teamMembers` | [`Record \| undefined`](../../doc/models/create-team-member-response.md) | Optional | The successfully created `TeamMember` objects. Each key is the `idempotency_key` that maps to the `CreateTeamMemberRequest`. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | The errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] + }, + "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" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/bulk-create-vendors-request.md b/legacy/doc/models/bulk-create-vendors-request.md new file mode 100644 index 000000000..a5f9ca240 --- /dev/null +++ b/legacy/doc/models/bulk-create-vendors-request.md @@ -0,0 +1,37 @@ + +# Bulk Create Vendors Request + +Represents an input to a call to [BulkCreateVendors](../../doc/api/vendors.md#bulk-create-vendors). + +## Structure + +`BulkCreateVendorsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `vendors` | [`Record`](../../doc/models/vendor.md) | Required | Specifies a set of new [Vendor](entity:Vendor) objects as represented by a collection of idempotency-key/`Vendor`-object pairs. | + +## Example (as JSON) + +```json +{ + "vendors": { + "key0": { + "id": "id8", + "created_at": "created_at6", + "updated_at": "updated_at4", + "name": "name8", + "address": { + "address_line_1": "address_line_16", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "locality": "locality6", + "sublocality": "sublocality6" + } + } + } +} +``` + diff --git a/legacy/doc/models/bulk-create-vendors-response.md b/legacy/doc/models/bulk-create-vendors-response.md new file mode 100644 index 000000000..f45e27994 --- /dev/null +++ b/legacy/doc/models/bulk-create-vendors-response.md @@ -0,0 +1,80 @@ + +# Bulk Create Vendors Response + +Represents an output from a call to [BulkCreateVendors](../../doc/api/vendors.md#bulk-create-vendors). + +## Structure + +`BulkCreateVendorsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `responses` | [`Record \| undefined`](../../doc/models/create-vendor-response.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "responses": { + "key0": { + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "vendor": { + "id": "id6", + "created_at": "created_at4", + "updated_at": "updated_at2", + "name": "name6", + "address": { + "address_line_1": "address_line_16", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "locality": "locality6", + "sublocality": "sublocality6" + } + } + } + } +} +``` + diff --git a/legacy/doc/models/bulk-delete-booking-custom-attributes-request.md b/legacy/doc/models/bulk-delete-booking-custom-attributes-request.md new file mode 100644 index 000000000..fc75ab336 --- /dev/null +++ b/legacy/doc/models/bulk-delete-booking-custom-attributes-request.md @@ -0,0 +1,28 @@ + +# Bulk Delete Booking Custom Attributes Request + +Represents a [BulkDeleteBookingCustomAttributes](../../doc/api/booking-custom-attributes.md#bulk-delete-booking-custom-attributes) request. + +## Structure + +`BulkDeleteBookingCustomAttributesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `values` | [`Record`](../../doc/models/booking-custom-attribute-delete-request.md) | Required | 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. | + +## Example (as JSON) + +```json +{ + "values": { + "key0": { + "booking_id": "booking_id4", + "key": "key0" + } + } +} +``` + diff --git a/legacy/doc/models/bulk-delete-booking-custom-attributes-response.md b/legacy/doc/models/bulk-delete-booking-custom-attributes-response.md new file mode 100644 index 000000000..a2e35eb1e --- /dev/null +++ b/legacy/doc/models/bulk-delete-booking-custom-attributes-response.md @@ -0,0 +1,39 @@ + +# Bulk Delete Booking Custom Attributes Response + +Represents a [BulkDeleteBookingCustomAttributes](../../doc/api/booking-custom-attributes.md#bulk-delete-booking-custom-attributes) response, +which contains a map of responses that each corresponds to an individual delete request. + +## Structure + +`BulkDeleteBookingCustomAttributesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `values` | [`Record \| undefined`](../../doc/models/booking-custom-attribute-delete-response.md) | Optional | 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` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "errors": [], + "values": { + "id1": { + "booking_id": "N3NCVYY3WS27HF0HKANA3R9FP8", + "errors": [] + }, + "id2": { + "booking_id": "SY8EMWRNDN3TQDP2H4KS1QWMMM", + "errors": [] + }, + "id3": { + "booking_id": "SY8EMWRNDN3TQDP2H4KS1QWMMM", + "errors": [] + } + } +} +``` + diff --git a/legacy/doc/models/bulk-delete-customers-request.md b/legacy/doc/models/bulk-delete-customers-request.md new file mode 100644 index 000000000..6e3b16ca6 --- /dev/null +++ b/legacy/doc/models/bulk-delete-customers-request.md @@ -0,0 +1,28 @@ + +# Bulk Delete Customers Request + +Defines the body parameters that can be included in requests to the +[BulkDeleteCustomers](../../doc/api/customers.md#bulk-delete-customers) endpoint. + +## Structure + +`BulkDeleteCustomersRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customerIds` | `string[]` | Required | The IDs of the [customer profiles](entity:Customer) to delete. | + +## Example (as JSON) + +```json +{ + "customer_ids": [ + "8DDA5NZVBZFGAX0V3HPF81HHE0", + "N18CPRVXR5214XPBBA6BZQWF3C", + "2GYD7WNXF7BJZW1PMGNXZ3Y8M8" + ] +} +``` + diff --git a/legacy/doc/models/bulk-delete-customers-response.md b/legacy/doc/models/bulk-delete-customers-response.md new file mode 100644 index 000000000..6248a455c --- /dev/null +++ b/legacy/doc/models/bulk-delete-customers-response.md @@ -0,0 +1,94 @@ + +# Bulk Delete Customers Response + +Defines the fields included in the response body from the +[BulkDeleteCustomers](../../doc/api/customers.md#bulk-delete-customers) endpoint. + +## Structure + +`BulkDeleteCustomersResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `responses` | [`Record \| undefined`](../../doc/models/delete-customer-response.md) | Optional | 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` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any top-level errors that prevented the bulk operation from running. | + +## Example (as JSON) + +```json +{ + "responses": { + "2GYD7WNXF7BJZW1PMGNXZ3Y8M8": { + "errors": [ + { + "category": "INVALID_REQUEST_ERROR", + "code": "NOT_FOUND", + "detail": "Customer with ID `2GYD7WNXF7BJZW1PMGNXZ3Y8M8` not found.", + "field": "field4" + } + ] + }, + "8DDA5NZVBZFGAX0V3HPF81HHE0": { + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] + }, + "N18CPRVXR5214XPBBA6BZQWF3C": { + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/bulk-delete-location-custom-attributes-request-location-custom-attribute-delete-request.md b/legacy/doc/models/bulk-delete-location-custom-attributes-request-location-custom-attribute-delete-request.md new file mode 100644 index 000000000..bad552070 --- /dev/null +++ b/legacy/doc/models/bulk-delete-location-custom-attributes-request-location-custom-attribute-delete-request.md @@ -0,0 +1,25 @@ + +# Bulk Delete Location Custom Attributes Request Location Custom Attribute Delete Request + +Represents an individual delete request in a [BulkDeleteLocationCustomAttributes](../../doc/api/location-custom-attributes.md#bulk-delete-location-custom-attributes) +request. An individual request contains an optional ID of the associated custom attribute definition +and optional key of the associated custom attribute definition. + +## Structure + +`BulkDeleteLocationCustomAttributesRequestLocationCustomAttributeDeleteRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `key` | `string \| undefined` | Optional | The key of the associated custom attribute definition.
Represented as a qualified key if the requesting app is not the definition owner.
**Constraints**: *Pattern*: `^([a-zA-Z0-9_-]+:)?[a-zA-Z0-9_-]{1,60}$` | + +## Example (as JSON) + +```json +{ + "key": "key8" +} +``` + diff --git a/legacy/doc/models/bulk-delete-location-custom-attributes-request.md b/legacy/doc/models/bulk-delete-location-custom-attributes-request.md new file mode 100644 index 000000000..a1aef2f59 --- /dev/null +++ b/legacy/doc/models/bulk-delete-location-custom-attributes-request.md @@ -0,0 +1,36 @@ + +# Bulk Delete Location Custom Attributes Request + +Represents a [BulkDeleteLocationCustomAttributes](../../doc/api/location-custom-attributes.md#bulk-delete-location-custom-attributes) request. + +## Structure + +`BulkDeleteLocationCustomAttributesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `values` | [`Record`](../../doc/models/bulk-delete-location-custom-attributes-request-location-custom-attribute-delete-request.md) | Required | The data used to update the `CustomAttribute` objects.
The keys must be unique and are used to map to the corresponding response. | + +## Example (as JSON) + +```json +{ + "values": { + "id1": { + "key": "bestseller", + "location_id": "L0TBCBTB7P8RQ" + }, + "id2": { + "key": "bestseller", + "location_id": "L9XMD04V3STJX" + }, + "id3": { + "key": "phone-number", + "location_id": "L0TBCBTB7P8RQ" + } + } +} +``` + diff --git a/legacy/doc/models/bulk-delete-location-custom-attributes-response-location-custom-attribute-delete-response.md b/legacy/doc/models/bulk-delete-location-custom-attributes-response-location-custom-attribute-delete-response.md new file mode 100644 index 000000000..2126937f1 --- /dev/null +++ b/legacy/doc/models/bulk-delete-location-custom-attributes-response-location-custom-attribute-delete-response.md @@ -0,0 +1,26 @@ + +# Bulk Delete Location Custom Attributes Response Location Custom Attribute Delete Response + +Represents an individual delete response in a [BulkDeleteLocationCustomAttributes](../../doc/api/location-custom-attributes.md#bulk-delete-location-custom-attributes) +request. + +## Structure + +`BulkDeleteLocationCustomAttributesResponseLocationCustomAttributeDeleteResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string \| undefined` | Optional | The ID of the location associated with the custom attribute. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Errors that occurred while processing the individual LocationCustomAttributeDeleteRequest request | + +## Example (as JSON) + +```json +{ + "errors": [], + "location_id": "L0TBCBTB7P8RQ" +} +``` + diff --git a/legacy/doc/models/bulk-delete-location-custom-attributes-response.md b/legacy/doc/models/bulk-delete-location-custom-attributes-response.md new file mode 100644 index 000000000..aa13e2c73 --- /dev/null +++ b/legacy/doc/models/bulk-delete-location-custom-attributes-response.md @@ -0,0 +1,46 @@ + +# Bulk Delete Location Custom Attributes Response + +Represents a [BulkDeleteLocationCustomAttributes](../../doc/api/location-custom-attributes.md#bulk-delete-location-custom-attributes) response, +which contains a map of responses that each corresponds to an individual delete request. + +## Structure + +`BulkDeleteLocationCustomAttributesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `values` | [`Record`](../../doc/models/bulk-delete-location-custom-attributes-response-location-custom-attribute-delete-response.md) | Required | A map of responses that correspond to individual delete requests. Each response has the
same key as the corresponding request. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "values": { + "id1": { + "errors": [], + "location_id": "L0TBCBTB7P8RQ" + }, + "id2": { + "errors": [], + "location_id": "L9XMD04V3STJX" + }, + "id3": { + "errors": [], + "location_id": "L0TBCBTB7P8RQ" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/bulk-delete-merchant-custom-attributes-request-merchant-custom-attribute-delete-request.md b/legacy/doc/models/bulk-delete-merchant-custom-attributes-request-merchant-custom-attribute-delete-request.md new file mode 100644 index 000000000..6c60937ba --- /dev/null +++ b/legacy/doc/models/bulk-delete-merchant-custom-attributes-request-merchant-custom-attribute-delete-request.md @@ -0,0 +1,25 @@ + +# Bulk Delete Merchant Custom Attributes Request Merchant Custom Attribute Delete Request + +Represents an individual delete request in a [BulkDeleteMerchantCustomAttributes](../../doc/api/merchant-custom-attributes.md#bulk-delete-merchant-custom-attributes) +request. An individual request contains an optional ID of the associated custom attribute definition +and optional key of the associated custom attribute definition. + +## Structure + +`BulkDeleteMerchantCustomAttributesRequestMerchantCustomAttributeDeleteRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `key` | `string \| undefined` | Optional | The key of the associated custom attribute definition.
Represented as a qualified key if the requesting app is not the definition owner.
**Constraints**: *Pattern*: `^([a-zA-Z0-9_-]+:)?[a-zA-Z0-9_-]{1,60}$` | + +## Example (as JSON) + +```json +{ + "key": "key0" +} +``` + diff --git a/legacy/doc/models/bulk-delete-merchant-custom-attributes-request.md b/legacy/doc/models/bulk-delete-merchant-custom-attributes-request.md new file mode 100644 index 000000000..77572b02e --- /dev/null +++ b/legacy/doc/models/bulk-delete-merchant-custom-attributes-request.md @@ -0,0 +1,32 @@ + +# Bulk Delete Merchant Custom Attributes Request + +Represents a [BulkDeleteMerchantCustomAttributes](../../doc/api/merchant-custom-attributes.md#bulk-delete-merchant-custom-attributes) request. + +## Structure + +`BulkDeleteMerchantCustomAttributesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `values` | [`Record`](../../doc/models/bulk-delete-merchant-custom-attributes-request-merchant-custom-attribute-delete-request.md) | Required | The data used to update the `CustomAttribute` objects.
The keys must be unique and are used to map to the corresponding response. | + +## Example (as JSON) + +```json +{ + "values": { + "id1": { + "key": "alternative_seller_name", + "merchant_id": "DM7VKY8Q63GNP" + }, + "id2": { + "key": "has_seen_tutorial", + "merchant_id": "DM7VKY8Q63GNP" + } + } +} +``` + diff --git a/legacy/doc/models/bulk-delete-merchant-custom-attributes-response-merchant-custom-attribute-delete-response.md b/legacy/doc/models/bulk-delete-merchant-custom-attributes-response-merchant-custom-attribute-delete-response.md new file mode 100644 index 000000000..c852cd851 --- /dev/null +++ b/legacy/doc/models/bulk-delete-merchant-custom-attributes-response-merchant-custom-attribute-delete-response.md @@ -0,0 +1,25 @@ + +# Bulk Delete Merchant Custom Attributes Response Merchant Custom Attribute Delete Response + +Represents an individual delete response in a [BulkDeleteMerchantCustomAttributes](../../doc/api/merchant-custom-attributes.md#bulk-delete-merchant-custom-attributes) +request. + +## Structure + +`BulkDeleteMerchantCustomAttributesResponseMerchantCustomAttributeDeleteResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Errors that occurred while processing the individual MerchantCustomAttributeDeleteRequest request | + +## Example (as JSON) + +```json +{ + "errors": [], + "merchant_id": "DM7VKY8Q63GNP" +} +``` + diff --git a/legacy/doc/models/bulk-delete-merchant-custom-attributes-response.md b/legacy/doc/models/bulk-delete-merchant-custom-attributes-response.md new file mode 100644 index 000000000..0a40638a2 --- /dev/null +++ b/legacy/doc/models/bulk-delete-merchant-custom-attributes-response.md @@ -0,0 +1,48 @@ + +# Bulk Delete Merchant Custom Attributes Response + +Represents a [BulkDeleteMerchantCustomAttributes](../../doc/api/merchant-custom-attributes.md#bulk-delete-merchant-custom-attributes) response, +which contains a map of responses that each corresponds to an individual delete request. + +## Structure + +`BulkDeleteMerchantCustomAttributesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `values` | [`Record`](../../doc/models/bulk-delete-merchant-custom-attributes-response-merchant-custom-attribute-delete-response.md) | Required | A map of responses that correspond to individual delete requests. Each response has the
same key as the corresponding request. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "values": { + "id1": { + "errors": [], + "merchant_id": "DM7VKY8Q63GNP" + }, + "id2": { + "errors": [], + "merchant_id": "DM7VKY8Q63GNP" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/bulk-delete-order-custom-attributes-request-delete-custom-attribute.md b/legacy/doc/models/bulk-delete-order-custom-attributes-request-delete-custom-attribute.md new file mode 100644 index 000000000..2cecded46 --- /dev/null +++ b/legacy/doc/models/bulk-delete-order-custom-attributes-request-delete-custom-attribute.md @@ -0,0 +1,25 @@ + +# Bulk Delete Order Custom Attributes Request Delete Custom Attribute + +Represents one delete within the bulk operation. + +## Structure + +`BulkDeleteOrderCustomAttributesRequestDeleteCustomAttribute` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `key` | `string \| undefined` | Optional | The key of the custom attribute to delete. This key must match the key
of an existing custom attribute definition.
**Constraints**: *Minimum Length*: `1`, *Pattern*: `^([a-zA-Z0-9_-]+:)?[a-zA-Z0-9_-]{1,60}$` | +| `orderId` | `string` | Required | The ID of the target [order](entity:Order).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | + +## Example (as JSON) + +```json +{ + "key": "key2", + "order_id": "order_id6" +} +``` + diff --git a/legacy/doc/models/bulk-delete-order-custom-attributes-request.md b/legacy/doc/models/bulk-delete-order-custom-attributes-request.md new file mode 100644 index 000000000..576ce6c91 --- /dev/null +++ b/legacy/doc/models/bulk-delete-order-custom-attributes-request.md @@ -0,0 +1,32 @@ + +# Bulk Delete Order Custom Attributes Request + +Represents a bulk delete request for one or more order custom attributes. + +## Structure + +`BulkDeleteOrderCustomAttributesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `values` | [`Record`](../../doc/models/bulk-delete-order-custom-attributes-request-delete-custom-attribute.md) | Required | A map of requests that correspond to individual delete operations for custom attributes. | + +## Example (as JSON) + +```json +{ + "values": { + "cover-count": { + "key": "cover-count", + "order_id": "7BbXGEIWNldxAzrtGf9GPVZTwZ4F" + }, + "table-number": { + "key": "table-number", + "order_id": "7BbXGEIWNldxAzrtGf9GPVZTwZ4F" + } + } +} +``` + diff --git a/legacy/doc/models/bulk-delete-order-custom-attributes-response.md b/legacy/doc/models/bulk-delete-order-custom-attributes-response.md new file mode 100644 index 000000000..968c29259 --- /dev/null +++ b/legacy/doc/models/bulk-delete-order-custom-attributes-response.md @@ -0,0 +1,65 @@ + +# Bulk Delete Order Custom Attributes Response + +Represents a response from deleting one or more order custom attributes. + +## Structure + +`BulkDeleteOrderCustomAttributesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `values` | [`Record`](../../doc/models/delete-order-custom-attribute-response.md) | Required | 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. | + +## Example (as JSON) + +```json +{ + "values": { + "cover-count": { + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] + }, + "table-number": { + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/bulk-retrieve-bookings-request.md b/legacy/doc/models/bulk-retrieve-bookings-request.md new file mode 100644 index 000000000..fc710e905 --- /dev/null +++ b/legacy/doc/models/bulk-retrieve-bookings-request.md @@ -0,0 +1,27 @@ + +# Bulk Retrieve Bookings Request + +Request payload for bulk retrieval of bookings. + +## Structure + +`BulkRetrieveBookingsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `bookingIds` | `string[]` | Required | A non-empty list of [Booking](entity:Booking) IDs specifying bookings to retrieve. | + +## Example (as JSON) + +```json +{ + "booking_ids": [ + "booking_ids8", + "booking_ids9", + "booking_ids0" + ] +} +``` + diff --git a/legacy/doc/models/bulk-retrieve-bookings-response.md b/legacy/doc/models/bulk-retrieve-bookings-response.md new file mode 100644 index 000000000..eab550445 --- /dev/null +++ b/legacy/doc/models/bulk-retrieve-bookings-response.md @@ -0,0 +1,89 @@ + +# Bulk Retrieve Bookings Response + +Response payload for bulk retrieval of bookings. + +## Structure + +`BulkRetrieveBookingsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `bookings` | [`Record \| undefined`](../../doc/models/retrieve-booking-response.md) | Optional | Requested bookings returned as a map containing `booking_id` as the key and `RetrieveBookingResponse` as the value. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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" + } + ], + "booking": { + "id": "id4", + "version": 156, + "status": "CANCELLED_BY_SELLER", + "created_at": "created_at2", + "updated_at": "updated_at0" + } + }, + "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": [] +} +``` + diff --git a/legacy/doc/models/bulk-retrieve-customers-request.md b/legacy/doc/models/bulk-retrieve-customers-request.md new file mode 100644 index 000000000..105de43db --- /dev/null +++ b/legacy/doc/models/bulk-retrieve-customers-request.md @@ -0,0 +1,28 @@ + +# Bulk Retrieve Customers Request + +Defines the body parameters that can be included in requests to the +[BulkRetrieveCustomers](../../doc/api/customers.md#bulk-retrieve-customers) endpoint. + +## Structure + +`BulkRetrieveCustomersRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customerIds` | `string[]` | Required | The IDs of the [customer profiles](entity:Customer) to retrieve. | + +## Example (as JSON) + +```json +{ + "customer_ids": [ + "8DDA5NZVBZFGAX0V3HPF81HHE0", + "N18CPRVXR5214XPBBA6BZQWF3C", + "2GYD7WNXF7BJZW1PMGNXZ3Y8M8" + ] +} +``` + diff --git a/legacy/doc/models/bulk-retrieve-customers-response.md b/legacy/doc/models/bulk-retrieve-customers-response.md new file mode 100644 index 000000000..bae160c68 --- /dev/null +++ b/legacy/doc/models/bulk-retrieve-customers-response.md @@ -0,0 +1,142 @@ + +# Bulk Retrieve Customers Response + +Defines the fields included in the response body from the +[BulkRetrieveCustomers](../../doc/api/customers.md#bulk-retrieve-customers) endpoint. + +## Structure + +`BulkRetrieveCustomersResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `responses` | [`Record \| undefined`](../../doc/models/retrieve-customer-response.md) | Optional | 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` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any top-level errors that prevented the bulk operation from running. | + +## Example (as JSON) + +```json +{ + "responses": { + "2GYD7WNXF7BJZW1PMGNXZ3Y8M8": { + "errors": [ + { + "category": "INVALID_REQUEST_ERROR", + "code": "NOT_FOUND", + "detail": "Customer with ID `2GYD7WNXF7BJZW1PMGNXZ3Y8M8` not found.", + "field": "field4" + } + ], + "customer": { + "id": "id0", + "created_at": "created_at2", + "updated_at": "updated_at4", + "cards": [ + { + "id": "id8", + "card_brand": "DISCOVER", + "last_4": "last_40", + "exp_month": 152, + "exp_year": 144 + } + ], + "given_name": "given_name2" + } + }, + "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 + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] + }, + "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 + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/bulk-retrieve-team-member-booking-profiles-request.md b/legacy/doc/models/bulk-retrieve-team-member-booking-profiles-request.md new file mode 100644 index 000000000..a14fa8fca --- /dev/null +++ b/legacy/doc/models/bulk-retrieve-team-member-booking-profiles-request.md @@ -0,0 +1,26 @@ + +# Bulk Retrieve Team Member Booking Profiles Request + +Request payload for the [BulkRetrieveTeamMemberBookingProfiles](../../doc/api/bookings.md#bulk-retrieve-team-member-booking-profiles) endpoint. + +## Structure + +`BulkRetrieveTeamMemberBookingProfilesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `teamMemberIds` | `string[]` | Required | A non-empty list of IDs of team members whose booking profiles you want to retrieve. | + +## Example (as JSON) + +```json +{ + "team_member_ids": [ + "team_member_ids1", + "team_member_ids2" + ] +} +``` + diff --git a/legacy/doc/models/bulk-retrieve-team-member-booking-profiles-response.md b/legacy/doc/models/bulk-retrieve-team-member-booking-profiles-response.md new file mode 100644 index 000000000..c4a2465a0 --- /dev/null +++ b/legacy/doc/models/bulk-retrieve-team-member-booking-profiles-response.md @@ -0,0 +1,59 @@ + +# Bulk Retrieve Team Member Booking Profiles Response + +Response payload for the [BulkRetrieveTeamMemberBookingProfiles](../../doc/api/bookings.md#bulk-retrieve-team-member-booking-profiles) endpoint. + +## Structure + +`BulkRetrieveTeamMemberBookingProfilesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `teamMemberBookingProfiles` | [`Record \| undefined`](../../doc/models/retrieve-team-member-booking-profile-response.md) | Optional | The returned team members' booking profiles, as a map with `team_member_id` as the key and [TeamMemberBookingProfile](entity:TeamMemberBookingProfile) the value. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "errors": [], + "team_member_booking_profiles": { + "TMXUrsBWWcHTt79t": { + "errors": [ + { + "category": "INVALID_REQUEST_ERROR", + "code": "NOT_FOUND", + "detail": "Resource not found.", + "field": "field4" + } + ], + "team_member_booking_profile": { + "team_member_id": "team_member_id2", + "description": "description2", + "display_name": "display_name2", + "is_bookable": false, + "profile_image_url": "profile_image_url8" + } + }, + "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" + } + } + } +} +``` + diff --git a/legacy/doc/models/bulk-retrieve-vendors-request.md b/legacy/doc/models/bulk-retrieve-vendors-request.md new file mode 100644 index 000000000..23e96b2d2 --- /dev/null +++ b/legacy/doc/models/bulk-retrieve-vendors-request.md @@ -0,0 +1,25 @@ + +# Bulk Retrieve Vendors Request + +Represents an input to a call to [BulkRetrieveVendors](../../doc/api/vendors.md#bulk-retrieve-vendors). + +## Structure + +`BulkRetrieveVendorsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `vendorIds` | `string[] \| null \| undefined` | Optional | IDs of the [Vendor](entity:Vendor) objects to retrieve. | + +## Example (as JSON) + +```json +{ + "vendor_ids": [ + "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4" + ] +} +``` + diff --git a/legacy/doc/models/bulk-retrieve-vendors-response.md b/legacy/doc/models/bulk-retrieve-vendors-response.md new file mode 100644 index 000000000..c6138d43f --- /dev/null +++ b/legacy/doc/models/bulk-retrieve-vendors-response.md @@ -0,0 +1,109 @@ + +# Bulk Retrieve Vendors Response + +Represents an output from a call to [BulkRetrieveVendors](../../doc/api/vendors.md#bulk-retrieve-vendors). + +## Structure + +`BulkRetrieveVendorsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `responses` | [`Record \| undefined`](../../doc/models/retrieve-vendor-response.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "responses": { + "key0": { + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "vendor": { + "id": "id6", + "created_at": "created_at4", + "updated_at": "updated_at2", + "name": "name6", + "address": { + "address_line_1": "address_line_16", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "locality": "locality6", + "sublocality": "sublocality6" + } + } + }, + "key1": { + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "vendor": { + "id": "id6", + "created_at": "created_at4", + "updated_at": "updated_at2", + "name": "name6", + "address": { + "address_line_1": "address_line_16", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "locality": "locality6", + "sublocality": "sublocality6" + } + } + } + } +} +``` + diff --git a/legacy/doc/models/bulk-swap-plan-request.md b/legacy/doc/models/bulk-swap-plan-request.md new file mode 100644 index 000000000..2b448d4e7 --- /dev/null +++ b/legacy/doc/models/bulk-swap-plan-request.md @@ -0,0 +1,28 @@ + +# Bulk Swap Plan Request + +Defines input parameters in a call to the +[BulkSwapPlan](../../doc/api/subscriptions.md#bulk-swap-plan) endpoint. + +## Structure + +`BulkSwapPlanRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `newPlanVariationId` | `string` | Required | The ID of the new subscription plan variation.

This field is required.
**Constraints**: *Minimum Length*: `1` | +| `oldPlanVariationId` | `string` | Required | 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.
**Constraints**: *Minimum Length*: `1` | +| `locationId` | `string` | Required | The ID of the location to associate with the swapped subscriptions.
**Constraints**: *Minimum Length*: `1` | + +## Example (as JSON) + +```json +{ + "location_id": "S8GWD5R9QB376", + "new_plan_variation_id": "FQ7CDXXWSLUJRPM3GFJSJGZ7", + "old_plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H" +} +``` + diff --git a/legacy/doc/models/bulk-swap-plan-response.md b/legacy/doc/models/bulk-swap-plan-response.md new file mode 100644 index 000000000..24f7a8144 --- /dev/null +++ b/legacy/doc/models/bulk-swap-plan-response.md @@ -0,0 +1,39 @@ + +# Bulk Swap Plan Response + +Defines output parameters in a response of the +[BulkSwapPlan](../../doc/api/subscriptions.md#bulk-swap-plan) endpoint. + +## Structure + +`BulkSwapPlanResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Errors encountered during the request. | +| `affectedSubscriptions` | `number \| undefined` | Optional | The number of affected subscriptions. | + +## Example (as JSON) + +```json +{ + "affected_subscriptions": 12, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/bulk-update-customer-data.md b/legacy/doc/models/bulk-update-customer-data.md new file mode 100644 index 000000000..1f73a64e5 --- /dev/null +++ b/legacy/doc/models/bulk-update-customer-data.md @@ -0,0 +1,39 @@ + +# Bulk Update Customer Data + +Defines the customer data provided in individual update requests for a +[BulkUpdateCustomers](../../doc/api/customers.md#bulk-update-customers) operation. + +## Structure + +`BulkUpdateCustomerData` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `givenName` | `string \| null \| undefined` | Optional | The given name (that is, the first name) associated with the customer profile.
**Constraints**: *Maximum Length*: `300` | +| `familyName` | `string \| null \| undefined` | Optional | The family name (that is, the last name) associated with the customer profile.
**Constraints**: *Maximum Length*: `300` | +| `companyName` | `string \| null \| undefined` | Optional | A business name associated with the customer profile.
**Constraints**: *Maximum Length*: `500` | +| `nickname` | `string \| null \| undefined` | Optional | A nickname for the customer profile.
**Constraints**: *Maximum Length*: `100` | +| `emailAddress` | `string \| null \| undefined` | Optional | The email address associated with the customer profile.
**Constraints**: *Maximum Length*: `254` | +| `address` | [`Address \| undefined`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | +| `phoneNumber` | `string \| null \| undefined` | Optional | 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). | +| `referenceId` | `string \| null \| undefined` | Optional | An optional second ID used to associate the customer profile with an
entity in another system.
**Constraints**: *Maximum Length*: `100` | +| `note` | `string \| null \| undefined` | Optional | An custom note associates with the customer profile. | +| `birthday` | `string \| null \| undefined` | Optional | 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. | +| `taxIds` | [`CustomerTaxIds \| undefined`](../../doc/models/customer-tax-ids.md) | Optional | Represents the tax ID associated with a [customer profile](../../doc/models/customer.md). 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). | +| `version` | `bigint \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "given_name": "given_name4", + "family_name": "family_name4", + "company_name": "company_name8", + "nickname": "nickname8", + "email_address": "email_address0" +} +``` + diff --git a/legacy/doc/models/bulk-update-customers-request.md b/legacy/doc/models/bulk-update-customers-request.md new file mode 100644 index 000000000..27863a7a3 --- /dev/null +++ b/legacy/doc/models/bulk-update-customers-request.md @@ -0,0 +1,43 @@ + +# Bulk Update Customers Request + +Defines the body parameters that can be included in requests to the +[BulkUpdateCustomers](../../doc/api/customers.md#bulk-update-customers) endpoint. + +## Structure + +`BulkUpdateCustomersRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customers` | [`Record`](../../doc/models/bulk-update-customer-data.md) | Required | 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`. | + +## Example (as JSON) + +```json +{ + "customers": { + "8DDA5NZVBZFGAX0V3HPF81HHE0": { + "email_address": "New.Amelia.Earhart@example.com", + "note": "updated customer note", + "phone_number": null, + "version": 2, + "given_name": "given_name4", + "family_name": "family_name6", + "company_name": "company_name8", + "nickname": "nickname8" + }, + "N18CPRVXR5214XPBBA6BZQWF3C": { + "family_name": "Curie", + "given_name": "Marie", + "version": 0, + "company_name": "company_name8", + "nickname": "nickname8", + "email_address": "email_address0" + } + } +} +``` + diff --git a/legacy/doc/models/bulk-update-customers-response.md b/legacy/doc/models/bulk-update-customers-response.md new file mode 100644 index 000000000..abe60297c --- /dev/null +++ b/legacy/doc/models/bulk-update-customers-response.md @@ -0,0 +1,135 @@ + +# Bulk Update Customers Response + +Defines the fields included in the response body from the +[BulkUpdateCustomers](../../doc/api/customers.md#bulk-update-customers) endpoint. + +## Structure + +`BulkUpdateCustomersResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `responses` | [`Record \| undefined`](../../doc/models/update-customer-response.md) | Optional | 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` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any top-level errors that prevented the bulk operation from running. | + +## Example (as JSON) + +```json +{ + "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, + "cards": [ + { + "id": "id8", + "card_brand": "DISCOVER", + "last_4": "last_40", + "exp_month": 152, + "exp_year": 144 + } + ] + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] + }, + "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, + "cards": [ + { + "id": "id8", + "card_brand": "DISCOVER", + "last_4": "last_40", + "exp_month": 152, + "exp_year": 144 + } + ] + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/bulk-update-team-members-request.md b/legacy/doc/models/bulk-update-team-members-request.md new file mode 100644 index 000000000..d4888a0e7 --- /dev/null +++ b/legacy/doc/models/bulk-update-team-members-request.md @@ -0,0 +1,58 @@ + +# Bulk Update Team Members Request + +Represents a bulk update request for `TeamMember` objects. + +## Structure + +`BulkUpdateTeamMembersRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `teamMembers` | [`Record`](../../doc/models/update-team-member-request.md) | Required | 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. | + +## Example (as JSON) + +```json +{ + "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", + "id": "id6" + } + }, + "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", + "id": "id6" + } + } + } +} +``` + diff --git a/legacy/doc/models/bulk-update-team-members-response.md b/legacy/doc/models/bulk-update-team-members-response.md new file mode 100644 index 000000000..1444c8d3a --- /dev/null +++ b/legacy/doc/models/bulk-update-team-members-response.md @@ -0,0 +1,99 @@ + +# Bulk Update Team Members Response + +Represents a response from a bulk update request containing the updated `TeamMember` objects or error messages. + +## Structure + +`BulkUpdateTeamMembersResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `teamMembers` | [`Record \| undefined`](../../doc/models/update-team-member-response.md) | Optional | The successfully updated `TeamMember` objects. Each key is the `team_member_id` that maps to the `UpdateTeamMemberRequest`. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | The errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] + }, + "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" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/bulk-update-vendors-request.md b/legacy/doc/models/bulk-update-vendors-request.md new file mode 100644 index 000000000..fc0094e5b --- /dev/null +++ b/legacy/doc/models/bulk-update-vendors-request.md @@ -0,0 +1,72 @@ + +# Bulk Update Vendors Request + +Represents an input to a call to [BulkUpdateVendors](../../doc/api/vendors.md#bulk-update-vendors). + +## Structure + +`BulkUpdateVendorsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `vendors` | [`Record`](../../doc/models/update-vendor-request.md) | Required | 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. | + +## Example (as JSON) + +```json +{ + "vendors": { + "key0": { + "idempotency_key": "idempotency_key4", + "vendor": { + "id": "id6", + "created_at": "created_at4", + "updated_at": "updated_at2", + "name": "name6", + "address": { + "address_line_1": "address_line_16", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "locality": "locality6", + "sublocality": "sublocality6" + } + } + }, + "key1": { + "idempotency_key": "idempotency_key4", + "vendor": { + "id": "id6", + "created_at": "created_at4", + "updated_at": "updated_at2", + "name": "name6", + "address": { + "address_line_1": "address_line_16", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "locality": "locality6", + "sublocality": "sublocality6" + } + } + }, + "key2": { + "idempotency_key": "idempotency_key4", + "vendor": { + "id": "id6", + "created_at": "created_at4", + "updated_at": "updated_at2", + "name": "name6", + "address": { + "address_line_1": "address_line_16", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "locality": "locality6", + "sublocality": "sublocality6" + } + } + } + } +} +``` + diff --git a/legacy/doc/models/bulk-update-vendors-response.md b/legacy/doc/models/bulk-update-vendors-response.md new file mode 100644 index 000000000..620f87349 --- /dev/null +++ b/legacy/doc/models/bulk-update-vendors-response.md @@ -0,0 +1,139 @@ + +# Bulk Update Vendors Response + +Represents an output from a call to [BulkUpdateVendors](../../doc/api/vendors.md#bulk-update-vendors). + +## Structure + +`BulkUpdateVendorsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Errors encountered when the request fails. | +| `responses` | [`Record \| undefined`](../../doc/models/update-vendor-response.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "responses": { + "INV_V_FMCYHBWT1TPL8MFH52PBMEN92A": { + "vendor": { + "address": { + "address_line_1": "202 Mill St", + "administrative_district_level_1": "NJ", + "country": "US", + "locality": "Moorestown", + "postal_code": "08057", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "sublocality": "sublocality6" + }, + "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 + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] + }, + "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", + "address_line_3": "address_line_32", + "sublocality": "sublocality6" + }, + "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 + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/bulk-upsert-booking-custom-attributes-request.md b/legacy/doc/models/bulk-upsert-booking-custom-attributes-request.md new file mode 100644 index 000000000..08c59f243 --- /dev/null +++ b/legacy/doc/models/bulk-upsert-booking-custom-attributes-request.md @@ -0,0 +1,70 @@ + +# Bulk Upsert Booking Custom Attributes Request + +Represents a [BulkUpsertBookingCustomAttributes](../../doc/api/booking-custom-attributes.md#bulk-upsert-booking-custom-attributes) request. + +## Structure + +`BulkUpsertBookingCustomAttributesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `values` | [`Record`](../../doc/models/booking-custom-attribute-upsert-request.md) | Required | 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. | + +## Example (as JSON) + +```json +{ + "values": { + "key0": { + "booking_id": "booking_id4", + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "idempotency_key": "idempotency_key6" + }, + "key1": { + "booking_id": "booking_id4", + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "idempotency_key": "idempotency_key6" + } + } +} +``` + diff --git a/legacy/doc/models/bulk-upsert-booking-custom-attributes-response.md b/legacy/doc/models/bulk-upsert-booking-custom-attributes-response.md new file mode 100644 index 000000000..6a91fe092 --- /dev/null +++ b/legacy/doc/models/bulk-upsert-booking-custom-attributes-response.md @@ -0,0 +1,142 @@ + +# Bulk Upsert Booking Custom Attributes Response + +Represents a [BulkUpsertBookingCustomAttributes](../../doc/api/booking-custom-attributes.md#bulk-upsert-booking-custom-attributes) response, +which contains a map of responses that each corresponds to an individual upsert request. + +## Structure + +`BulkUpsertBookingCustomAttributesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `values` | [`Record \| undefined`](../../doc/models/booking-custom-attribute-upsert-response.md) | Optional | 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` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "values": { + "key0": { + "booking_id": "booking_id4", + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] + }, + "key1": { + "booking_id": "booking_id4", + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] + }, + "key2": { + "booking_id": "booking_id4", + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/bulk-upsert-customer-custom-attributes-request-customer-custom-attribute-upsert-request.md b/legacy/doc/models/bulk-upsert-customer-custom-attributes-request-customer-custom-attribute-upsert-request.md new file mode 100644 index 000000000..0456a25c6 --- /dev/null +++ b/legacy/doc/models/bulk-upsert-customer-custom-attributes-request-customer-custom-attribute-upsert-request.md @@ -0,0 +1,47 @@ + +# Bulk Upsert Customer Custom Attributes Request Customer Custom Attribute Upsert Request + +Represents an individual upsert request in a [BulkUpsertCustomerCustomAttributes](../../doc/api/customer-custom-attributes.md#bulk-upsert-customer-custom-attributes) +request. An individual request contains a customer ID, the custom attribute to create or update, +and an optional idempotency key. + +## Structure + +`BulkUpsertCustomerCustomAttributesRequestCustomerCustomAttributeUpsertRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customerId` | `string` | Required | The ID of the target [customer profile](entity:Customer).
**Constraints**: *Minimum Length*: `1` | +| `customAttribute` | [`CustomAttribute`](../../doc/models/custom-attribute.md) | Required | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | +| `idempotencyKey` | `string \| null \| undefined` | Optional | 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).
**Constraints**: *Maximum Length*: `45` | + +## Example (as JSON) + +```json +{ + "customer_id": "customer_id0", + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "idempotency_key": "idempotency_key8" +} +``` + diff --git a/legacy/doc/models/bulk-upsert-customer-custom-attributes-request.md b/legacy/doc/models/bulk-upsert-customer-custom-attributes-request.md new file mode 100644 index 000000000..ba313c34f --- /dev/null +++ b/legacy/doc/models/bulk-upsert-customer-custom-attributes-request.md @@ -0,0 +1,47 @@ + +# Bulk Upsert Customer Custom Attributes Request + +Represents a [BulkUpsertCustomerCustomAttributes](../../doc/api/customer-custom-attributes.md#bulk-upsert-customer-custom-attributes) request. + +## Structure + +`BulkUpsertCustomerCustomAttributesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `values` | [`Record`](../../doc/models/bulk-upsert-customer-custom-attributes-request-customer-custom-attribute-upsert-request.md) | Required | 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. | + +## Example (as JSON) + +```json +{ + "values": { + "key0": { + "customer_id": "customer_id8", + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "idempotency_key": "idempotency_key6" + } + } +} +``` + diff --git a/legacy/doc/models/bulk-upsert-customer-custom-attributes-response-customer-custom-attribute-upsert-response.md b/legacy/doc/models/bulk-upsert-customer-custom-attributes-response-customer-custom-attribute-upsert-response.md new file mode 100644 index 000000000..3a8d7d868 --- /dev/null +++ b/legacy/doc/models/bulk-upsert-customer-custom-attributes-response-customer-custom-attribute-upsert-response.md @@ -0,0 +1,64 @@ + +# Bulk Upsert Customer Custom Attributes Response Customer Custom Attribute Upsert Response + +Represents a response for an individual upsert request in a [BulkUpsertCustomerCustomAttributes](../../doc/api/customer-custom-attributes.md#bulk-upsert-customer-custom-attributes) operation. + +## Structure + +`BulkUpsertCustomerCustomAttributesResponseCustomerCustomAttributeUpsertResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customerId` | `string \| undefined` | Optional | The ID of the customer profile associated with the custom attribute. | +| `customAttribute` | [`CustomAttribute \| undefined`](../../doc/models/custom-attribute.md) | Optional | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred while processing the individual request. | + +## Example (as JSON) + +```json +{ + "customer_id": "customer_id4", + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/bulk-upsert-customer-custom-attributes-response.md b/legacy/doc/models/bulk-upsert-customer-custom-attributes-response.md new file mode 100644 index 000000000..3c6132856 --- /dev/null +++ b/legacy/doc/models/bulk-upsert-customer-custom-attributes-response.md @@ -0,0 +1,154 @@ + +# Bulk Upsert Customer Custom Attributes Response + +Represents a [BulkUpsertCustomerCustomAttributes](../../doc/api/customer-custom-attributes.md#bulk-upsert-customer-custom-attributes) response, +which contains a map of responses that each corresponds to an individual upsert request. + +## Structure + +`BulkUpsertCustomerCustomAttributesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `values` | [`Record \| undefined`](../../doc/models/bulk-upsert-customer-custom-attributes-response-customer-custom-attribute-upsert-response.md) | Optional | 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` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "values": { + "key0": { + "customer_id": "customer_id8", + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] + }, + "key1": { + "customer_id": "customer_id8", + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] + }, + "key2": { + "customer_id": "customer_id8", + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/bulk-upsert-location-custom-attributes-request-location-custom-attribute-upsert-request.md b/legacy/doc/models/bulk-upsert-location-custom-attributes-request-location-custom-attribute-upsert-request.md new file mode 100644 index 000000000..b9adfd557 --- /dev/null +++ b/legacy/doc/models/bulk-upsert-location-custom-attributes-request-location-custom-attribute-upsert-request.md @@ -0,0 +1,47 @@ + +# Bulk Upsert Location Custom Attributes Request Location Custom Attribute Upsert Request + +Represents an individual upsert request in a [BulkUpsertLocationCustomAttributes](../../doc/api/location-custom-attributes.md#bulk-upsert-location-custom-attributes) +request. An individual request contains a location ID, the custom attribute to create or update, +and an optional idempotency key. + +## Structure + +`BulkUpsertLocationCustomAttributesRequestLocationCustomAttributeUpsertRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string` | Required | The ID of the target [location](entity:Location).
**Constraints**: *Minimum Length*: `1` | +| `customAttribute` | [`CustomAttribute`](../../doc/models/custom-attribute.md) | Required | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | +| `idempotencyKey` | `string \| null \| undefined` | Optional | 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).
**Constraints**: *Maximum Length*: `45` | + +## Example (as JSON) + +```json +{ + "location_id": "location_id2", + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "idempotency_key": "idempotency_key4" +} +``` + diff --git a/legacy/doc/models/bulk-upsert-location-custom-attributes-request.md b/legacy/doc/models/bulk-upsert-location-custom-attributes-request.md new file mode 100644 index 000000000..74bde39d8 --- /dev/null +++ b/legacy/doc/models/bulk-upsert-location-custom-attributes-request.md @@ -0,0 +1,47 @@ + +# Bulk Upsert Location Custom Attributes Request + +Represents a [BulkUpsertLocationCustomAttributes](../../doc/api/location-custom-attributes.md#bulk-upsert-location-custom-attributes) request. + +## Structure + +`BulkUpsertLocationCustomAttributesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `values` | [`Record`](../../doc/models/bulk-upsert-location-custom-attributes-request-location-custom-attribute-upsert-request.md) | Required | 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. | + +## Example (as JSON) + +```json +{ + "values": { + "key0": { + "location_id": "location_id4", + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "idempotency_key": "idempotency_key6" + } + } +} +``` + diff --git a/legacy/doc/models/bulk-upsert-location-custom-attributes-response-location-custom-attribute-upsert-response.md b/legacy/doc/models/bulk-upsert-location-custom-attributes-response-location-custom-attribute-upsert-response.md new file mode 100644 index 000000000..7cc2d953e --- /dev/null +++ b/legacy/doc/models/bulk-upsert-location-custom-attributes-response-location-custom-attribute-upsert-response.md @@ -0,0 +1,58 @@ + +# Bulk Upsert Location Custom Attributes Response Location Custom Attribute Upsert Response + +Represents a response for an individual upsert request in a [BulkUpsertLocationCustomAttributes](../../doc/api/location-custom-attributes.md#bulk-upsert-location-custom-attributes) operation. + +## Structure + +`BulkUpsertLocationCustomAttributesResponseLocationCustomAttributeUpsertResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string \| undefined` | Optional | The ID of the location associated with the custom attribute. | +| `customAttribute` | [`CustomAttribute \| undefined`](../../doc/models/custom-attribute.md) | Optional | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred while processing the individual request. | + +## Example (as JSON) + +```json +{ + "location_id": "location_id8", + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/bulk-upsert-location-custom-attributes-response.md b/legacy/doc/models/bulk-upsert-location-custom-attributes-response.md new file mode 100644 index 000000000..f4d0bb911 --- /dev/null +++ b/legacy/doc/models/bulk-upsert-location-custom-attributes-response.md @@ -0,0 +1,76 @@ + +# Bulk Upsert Location Custom Attributes Response + +Represents a [BulkUpsertLocationCustomAttributes](../../doc/api/location-custom-attributes.md#bulk-upsert-location-custom-attributes) response, +which contains a map of responses that each corresponds to an individual upsert request. + +## Structure + +`BulkUpsertLocationCustomAttributesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `values` | [`Record \| undefined`](../../doc/models/bulk-upsert-location-custom-attributes-response-location-custom-attribute-upsert-response.md) | Optional | 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` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "values": { + "key0": { + "location_id": "location_id4", + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/bulk-upsert-merchant-custom-attributes-request-merchant-custom-attribute-upsert-request.md b/legacy/doc/models/bulk-upsert-merchant-custom-attributes-request-merchant-custom-attribute-upsert-request.md new file mode 100644 index 000000000..d8c0488e3 --- /dev/null +++ b/legacy/doc/models/bulk-upsert-merchant-custom-attributes-request-merchant-custom-attribute-upsert-request.md @@ -0,0 +1,47 @@ + +# Bulk Upsert Merchant Custom Attributes Request Merchant Custom Attribute Upsert Request + +Represents an individual upsert request in a [BulkUpsertMerchantCustomAttributes](../../doc/api/merchant-custom-attributes.md#bulk-upsert-merchant-custom-attributes) +request. An individual request contains a merchant ID, the custom attribute to create or update, +and an optional idempotency key. + +## Structure + +`BulkUpsertMerchantCustomAttributesRequestMerchantCustomAttributeUpsertRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `merchantId` | `string` | Required | The ID of the target [merchant](entity:Merchant).
**Constraints**: *Minimum Length*: `1` | +| `customAttribute` | [`CustomAttribute`](../../doc/models/custom-attribute.md) | Required | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | +| `idempotencyKey` | `string \| null \| undefined` | Optional | 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).
**Constraints**: *Maximum Length*: `45` | + +## Example (as JSON) + +```json +{ + "merchant_id": "merchant_id8", + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "idempotency_key": "idempotency_key4" +} +``` + diff --git a/legacy/doc/models/bulk-upsert-merchant-custom-attributes-request.md b/legacy/doc/models/bulk-upsert-merchant-custom-attributes-request.md new file mode 100644 index 000000000..d3214da78 --- /dev/null +++ b/legacy/doc/models/bulk-upsert-merchant-custom-attributes-request.md @@ -0,0 +1,93 @@ + +# Bulk Upsert Merchant Custom Attributes Request + +Represents a [BulkUpsertMerchantCustomAttributes](../../doc/api/merchant-custom-attributes.md#bulk-upsert-merchant-custom-attributes) request. + +## Structure + +`BulkUpsertMerchantCustomAttributesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `values` | [`Record`](../../doc/models/bulk-upsert-merchant-custom-attributes-request-merchant-custom-attribute-upsert-request.md) | Required | 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. | + +## Example (as JSON) + +```json +{ + "values": { + "key0": { + "merchant_id": "merchant_id0", + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "idempotency_key": "idempotency_key6" + }, + "key1": { + "merchant_id": "merchant_id0", + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "idempotency_key": "idempotency_key6" + }, + "key2": { + "merchant_id": "merchant_id0", + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "idempotency_key": "idempotency_key6" + } + } +} +``` + diff --git a/legacy/doc/models/bulk-upsert-merchant-custom-attributes-response-merchant-custom-attribute-upsert-response.md b/legacy/doc/models/bulk-upsert-merchant-custom-attributes-response-merchant-custom-attribute-upsert-response.md new file mode 100644 index 000000000..0710416bc --- /dev/null +++ b/legacy/doc/models/bulk-upsert-merchant-custom-attributes-response-merchant-custom-attribute-upsert-response.md @@ -0,0 +1,64 @@ + +# Bulk Upsert Merchant Custom Attributes Response Merchant Custom Attribute Upsert Response + +Represents a response for an individual upsert request in a [BulkUpsertMerchantCustomAttributes](../../doc/api/merchant-custom-attributes.md#bulk-upsert-merchant-custom-attributes) operation. + +## Structure + +`BulkUpsertMerchantCustomAttributesResponseMerchantCustomAttributeUpsertResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `merchantId` | `string \| undefined` | Optional | The ID of the merchant associated with the custom attribute. | +| `customAttribute` | [`CustomAttribute \| undefined`](../../doc/models/custom-attribute.md) | Optional | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred while processing the individual request. | + +## Example (as JSON) + +```json +{ + "merchant_id": "merchant_id0", + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/bulk-upsert-merchant-custom-attributes-response.md b/legacy/doc/models/bulk-upsert-merchant-custom-attributes-response.md new file mode 100644 index 000000000..736f11c9c --- /dev/null +++ b/legacy/doc/models/bulk-upsert-merchant-custom-attributes-response.md @@ -0,0 +1,106 @@ + +# Bulk Upsert Merchant Custom Attributes Response + +Represents a [BulkUpsertMerchantCustomAttributes](../../doc/api/merchant-custom-attributes.md#bulk-upsert-merchant-custom-attributes) response, +which contains a map of responses that each corresponds to an individual upsert request. + +## Structure + +`BulkUpsertMerchantCustomAttributesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `values` | [`Record \| undefined`](../../doc/models/bulk-upsert-merchant-custom-attributes-response-merchant-custom-attribute-upsert-response.md) | Optional | 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` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "values": { + "key0": { + "merchant_id": "merchant_id0", + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] + }, + "key1": { + "merchant_id": "merchant_id0", + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/bulk-upsert-order-custom-attributes-request-upsert-custom-attribute.md b/legacy/doc/models/bulk-upsert-order-custom-attributes-request-upsert-custom-attribute.md new file mode 100644 index 000000000..ed5b1e6e4 --- /dev/null +++ b/legacy/doc/models/bulk-upsert-order-custom-attributes-request-upsert-custom-attribute.md @@ -0,0 +1,45 @@ + +# Bulk Upsert Order Custom Attributes Request Upsert Custom Attribute + +Represents one upsert within the bulk operation. + +## Structure + +`BulkUpsertOrderCustomAttributesRequestUpsertCustomAttribute` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttribute` | [`CustomAttribute`](../../doc/models/custom-attribute.md) | Required | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | +| `idempotencyKey` | `string \| null \| undefined` | Optional | 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).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `45` | +| `orderId` | `string` | Required | The ID of the target [order](entity:Order).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | + +## Example (as JSON) + +```json +{ + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "idempotency_key": "idempotency_key4", + "order_id": "order_id2" +} +``` + diff --git a/legacy/doc/models/bulk-upsert-order-custom-attributes-request.md b/legacy/doc/models/bulk-upsert-order-custom-attributes-request.md new file mode 100644 index 000000000..3975a40d4 --- /dev/null +++ b/legacy/doc/models/bulk-upsert-order-custom-attributes-request.md @@ -0,0 +1,93 @@ + +# Bulk Upsert Order Custom Attributes Request + +Represents a bulk upsert request for one or more order custom attributes. + +## Structure + +`BulkUpsertOrderCustomAttributesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `values` | [`Record`](../../doc/models/bulk-upsert-order-custom-attributes-request-upsert-custom-attribute.md) | Required | A map of requests that correspond to individual upsert operations for custom attributes. | + +## Example (as JSON) + +```json +{ + "values": { + "key0": { + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "idempotency_key": "idempotency_key6", + "order_id": "order_id4" + }, + "key1": { + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "idempotency_key": "idempotency_key6", + "order_id": "order_id4" + }, + "key2": { + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "idempotency_key": "idempotency_key6", + "order_id": "order_id4" + } + } +} +``` + diff --git a/legacy/doc/models/bulk-upsert-order-custom-attributes-response.md b/legacy/doc/models/bulk-upsert-order-custom-attributes-response.md new file mode 100644 index 000000000..0f4ba02c8 --- /dev/null +++ b/legacy/doc/models/bulk-upsert-order-custom-attributes-response.md @@ -0,0 +1,74 @@ + +# Bulk Upsert Order Custom Attributes Response + +Represents a response from a bulk upsert of order custom attributes. + +## Structure + +`BulkUpsertOrderCustomAttributesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `values` | [`Record`](../../doc/models/upsert-order-custom-attribute-response.md) | Required | A map of responses that correspond to individual upsert operations for custom attributes. | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "values": { + "key0": { + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] + } + } +} +``` + diff --git a/legacy/doc/models/business-appointment-settings-alignment-time.md b/legacy/doc/models/business-appointment-settings-alignment-time.md new file mode 100644 index 000000000..65cf656fc --- /dev/null +++ b/legacy/doc/models/business-appointment-settings-alignment-time.md @@ -0,0 +1,18 @@ + +# Business Appointment Settings Alignment Time + +Time units of a service duration for bookings. + +## Enumeration + +`BusinessAppointmentSettingsAlignmentTime` + +## Fields + +| Name | Description | +| --- | --- | +| `SERVICE_DURATION` | The service duration unit is one visit of a fixed time interval specified by the seller. | +| `QUARTER_HOURLY` | The service duration unit is a 15-minute interval. Bookings can be scheduled every quarter hour. | +| `HALF_HOURLY` | The service duration unit is a 30-minute interval. Bookings can be scheduled every half hour. | +| `HOURLY` | The service duration unit is a 60-minute interval. Bookings can be scheduled every hour. | + diff --git a/legacy/doc/models/business-appointment-settings-booking-location-type.md b/legacy/doc/models/business-appointment-settings-booking-location-type.md new file mode 100644 index 000000000..5bf906052 --- /dev/null +++ b/legacy/doc/models/business-appointment-settings-booking-location-type.md @@ -0,0 +1,17 @@ + +# Business Appointment Settings Booking Location Type + +Supported types of location where service is provided. + +## Enumeration + +`BusinessAppointmentSettingsBookingLocationType` + +## Fields + +| Name | Description | +| --- | --- | +| `BUSINESS_LOCATION` | The service is provided at a seller location. | +| `CUSTOMER_LOCATION` | The service is provided at a customer location. | +| `PHONE` | The service is provided over the phone. | + diff --git a/legacy/doc/models/business-appointment-settings-cancellation-policy.md b/legacy/doc/models/business-appointment-settings-cancellation-policy.md new file mode 100644 index 000000000..37710f620 --- /dev/null +++ b/legacy/doc/models/business-appointment-settings-cancellation-policy.md @@ -0,0 +1,16 @@ + +# Business Appointment Settings Cancellation Policy + +The category of the seller’s cancellation policy. + +## Enumeration + +`BusinessAppointmentSettingsCancellationPolicy` + +## Fields + +| Name | Description | +| --- | --- | +| `CANCELLATION_TREATED_AS_NO_SHOW` | Cancellations are treated as no shows and may incur a fee as specified by `cancellation_fee_money`. | +| `CUSTOM_POLICY` | Cancellations follow the seller-specified policy that is described in free-form text and not enforced automatically by Square. | + diff --git a/legacy/doc/models/business-appointment-settings-max-appointments-per-day-limit-type.md b/legacy/doc/models/business-appointment-settings-max-appointments-per-day-limit-type.md new file mode 100644 index 000000000..7ce1edea7 --- /dev/null +++ b/legacy/doc/models/business-appointment-settings-max-appointments-per-day-limit-type.md @@ -0,0 +1,16 @@ + +# Business Appointment Settings Max Appointments Per Day Limit Type + +Types of daily appointment limits. + +## Enumeration + +`BusinessAppointmentSettingsMaxAppointmentsPerDayLimitType` + +## Fields + +| Name | Description | +| --- | --- | +| `PER_TEAM_MEMBER` | The maximum number of daily appointments is set on a per team member basis. | +| `PER_LOCATION` | The maximum number of daily appointments is set on a per location basis. | + diff --git a/legacy/doc/models/business-appointment-settings.md b/legacy/doc/models/business-appointment-settings.md new file mode 100644 index 000000000..ebcf877cb --- /dev/null +++ b/legacy/doc/models/business-appointment-settings.md @@ -0,0 +1,41 @@ + +# Business Appointment Settings + +The service appointment settings, including where and how the service is provided. + +## Structure + +`BusinessAppointmentSettings` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationTypes` | [`string[] \| null \| undefined`](../../doc/models/business-appointment-settings-booking-location-type.md) | Optional | Types of the location allowed for bookings.
See [BusinessAppointmentSettingsBookingLocationType](#type-businessappointmentsettingsbookinglocationtype) for possible values | +| `alignmentTime` | [`string \| undefined`](../../doc/models/business-appointment-settings-alignment-time.md) | Optional | Time units of a service duration for bookings. | +| `minBookingLeadTimeSeconds` | `number \| null \| undefined` | Optional | 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. | +| `maxBookingLeadTimeSeconds` | `number \| null \| undefined` | Optional | 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. | +| `anyTeamMemberBookingEnabled` | `boolean \| null \| undefined` | Optional | Indicates whether a customer can choose from all available time slots and have a staff member assigned
automatically (`true`) or not (`false`). | +| `multipleServiceBookingEnabled` | `boolean \| null \| undefined` | Optional | Indicates whether a customer can book multiple services in a single online booking. | +| `maxAppointmentsPerDayLimitType` | [`string \| undefined`](../../doc/models/business-appointment-settings-max-appointments-per-day-limit-type.md) | Optional | Types of daily appointment limits. | +| `maxAppointmentsPerDayLimit` | `number \| null \| undefined` | Optional | The maximum number of daily appointments per team member or per location. | +| `cancellationWindowSeconds` | `number \| null \| undefined` | Optional | The cut-off time in seconds for allowing clients to cancel or reschedule an appointment. | +| `cancellationFeeMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `cancellationPolicy` | [`string \| undefined`](../../doc/models/business-appointment-settings-cancellation-policy.md) | Optional | The category of the seller’s cancellation policy. | +| `cancellationPolicyText` | `string \| null \| undefined` | Optional | The free-form text of the seller's cancellation policy.
**Constraints**: *Maximum Length*: `65536` | +| `skipBookingFlowStaffSelection` | `boolean \| null \| undefined` | Optional | Indicates whether customers has an assigned staff member (`true`) or can select s staff member of their choice (`false`). | + +## Example (as JSON) + +```json +{ + "location_types": [ + "PHONE" + ], + "alignment_time": "SERVICE_DURATION", + "min_booking_lead_time_seconds": 88, + "max_booking_lead_time_seconds": 98, + "any_team_member_booking_enabled": false +} +``` + diff --git a/legacy/doc/models/business-booking-profile-booking-policy.md b/legacy/doc/models/business-booking-profile-booking-policy.md new file mode 100644 index 000000000..5104c3487 --- /dev/null +++ b/legacy/doc/models/business-booking-profile-booking-policy.md @@ -0,0 +1,16 @@ + +# Business Booking Profile Booking Policy + +Policies for accepting bookings. + +## Enumeration + +`BusinessBookingProfileBookingPolicy` + +## Fields + +| Name | Description | +| --- | --- | +| `ACCEPT_ALL` | The seller accepts all booking requests automatically. | +| `REQUIRES_ACCEPTANCE` | The seller must accept requests to complete bookings. | + diff --git a/legacy/doc/models/business-booking-profile-customer-timezone-choice.md b/legacy/doc/models/business-booking-profile-customer-timezone-choice.md new file mode 100644 index 000000000..a2c122829 --- /dev/null +++ b/legacy/doc/models/business-booking-profile-customer-timezone-choice.md @@ -0,0 +1,16 @@ + +# Business Booking Profile Customer Timezone Choice + +Choices of customer-facing time zone used for bookings. + +## Enumeration + +`BusinessBookingProfileCustomerTimezoneChoice` + +## Fields + +| Name | Description | +| --- | --- | +| `BUSINESS_LOCATION_TIMEZONE` | Use the time zone of the business location for bookings. | +| `CUSTOMER_CHOICE` | Use the customer-chosen time zone for bookings. | + diff --git a/legacy/doc/models/business-booking-profile.md b/legacy/doc/models/business-booking-profile.md new file mode 100644 index 000000000..0c5ca30a7 --- /dev/null +++ b/legacy/doc/models/business-booking-profile.md @@ -0,0 +1,34 @@ + +# Business Booking Profile + +A seller's business booking profile, including booking policy, appointment settings, etc. + +## Structure + +`BusinessBookingProfile` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `sellerId` | `string \| null \| undefined` | Optional | The ID of the seller, obtainable using the Merchants API.
**Constraints**: *Maximum Length*: `32` | +| `createdAt` | `string \| undefined` | Optional | The RFC 3339 timestamp specifying the booking's creation time. | +| `bookingEnabled` | `boolean \| null \| undefined` | Optional | Indicates whether the seller is open for booking. | +| `customerTimezoneChoice` | [`string \| undefined`](../../doc/models/business-booking-profile-customer-timezone-choice.md) | Optional | Choices of customer-facing time zone used for bookings. | +| `bookingPolicy` | [`string \| undefined`](../../doc/models/business-booking-profile-booking-policy.md) | Optional | Policies for accepting bookings. | +| `allowUserCancel` | `boolean \| null \| undefined` | Optional | Indicates whether customers can cancel or reschedule their own bookings (`true`) or not (`false`). | +| `businessAppointmentSettings` | [`BusinessAppointmentSettings \| undefined`](../../doc/models/business-appointment-settings.md) | Optional | The service appointment settings, including where and how the service is provided. | +| `supportSellerLevelWrites` | `boolean \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "seller_id": "seller_id8", + "created_at": "created_at8", + "booking_enabled": false, + "customer_timezone_choice": "BUSINESS_LOCATION_TIMEZONE", + "booking_policy": "ACCEPT_ALL" +} +``` + diff --git a/legacy/doc/models/business-hours-period.md b/legacy/doc/models/business-hours-period.md new file mode 100644 index 000000000..bfc2d3d3f --- /dev/null +++ b/legacy/doc/models/business-hours-period.md @@ -0,0 +1,27 @@ + +# Business Hours Period + +Represents a period of time during which a business location is open. + +## Structure + +`BusinessHoursPeriod` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `dayOfWeek` | [`string \| undefined`](../../doc/models/day-of-week.md) | Optional | Indicates the specific day of the week. | +| `startLocalTime` | `string \| null \| undefined` | Optional | 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. | +| `endLocalTime` | `string \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "day_of_week": "SUN", + "start_local_time": "start_local_time2", + "end_local_time": "end_local_time4" +} +``` + diff --git a/legacy/doc/models/business-hours.md b/legacy/doc/models/business-hours.md new file mode 100644 index 000000000..ccdf86f95 --- /dev/null +++ b/legacy/doc/models/business-hours.md @@ -0,0 +1,39 @@ + +# Business Hours + +The hours of operation for a location. + +## Structure + +`BusinessHours` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `periods` | [`BusinessHoursPeriod[] \| null \| undefined`](../../doc/models/business-hours-period.md) | Optional | The list of time periods during which the business is open. There can be at most 10 periods per day. | + +## Example (as JSON) + +```json +{ + "periods": [ + { + "day_of_week": "WED", + "start_local_time": "start_local_time4", + "end_local_time": "end_local_time6" + }, + { + "day_of_week": "WED", + "start_local_time": "start_local_time4", + "end_local_time": "end_local_time6" + }, + { + "day_of_week": "WED", + "start_local_time": "start_local_time4", + "end_local_time": "end_local_time6" + } + ] +} +``` + diff --git a/legacy/doc/models/buy-now-pay-later-details.md b/legacy/doc/models/buy-now-pay-later-details.md new file mode 100644 index 000000000..59a91767d --- /dev/null +++ b/legacy/doc/models/buy-now-pay-later-details.md @@ -0,0 +1,31 @@ + +# Buy Now Pay Later Details + +Additional details about a Buy Now Pay Later payment type. + +## Structure + +`BuyNowPayLaterDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `brand` | `string \| null \| undefined` | Optional | The brand used for the Buy Now Pay Later payment.
The brand can be `AFTERPAY`, `CLEARPAY` or `UNKNOWN`.
**Constraints**: *Maximum Length*: `50` | +| `afterpayDetails` | [`AfterpayDetails \| undefined`](../../doc/models/afterpay-details.md) | Optional | Additional details about Afterpay payments. | +| `clearpayDetails` | [`ClearpayDetails \| undefined`](../../doc/models/clearpay-details.md) | Optional | Additional details about Clearpay payments. | + +## Example (as JSON) + +```json +{ + "brand": "brand6", + "afterpay_details": { + "email_address": "email_address4" + }, + "clearpay_details": { + "email_address": "email_address4" + } +} +``` + diff --git a/legacy/doc/models/calculate-loyalty-points-request.md b/legacy/doc/models/calculate-loyalty-points-request.md new file mode 100644 index 000000000..52a6cb64c --- /dev/null +++ b/legacy/doc/models/calculate-loyalty-points-request.md @@ -0,0 +1,30 @@ + +# Calculate Loyalty Points Request + +Represents a [CalculateLoyaltyPoints](../../doc/api/loyalty.md#calculate-loyalty-points) request. + +## Structure + +`CalculateLoyaltyPointsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `orderId` | `string \| null \| undefined` | Optional | 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`. | +| `transactionAmountMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `loyaltyAccountId` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | + +## Example (as JSON) + +```json +{ + "loyalty_account_id": "79b807d2-d786-46a9-933b-918028d7a8c5", + "order_id": "RFZfrdtm3mhO1oGzf5Cx7fEMsmGZY", + "transaction_amount_money": { + "amount": 64, + "currency": "ANG" + } +} +``` + diff --git a/legacy/doc/models/calculate-loyalty-points-response.md b/legacy/doc/models/calculate-loyalty-points-response.md new file mode 100644 index 000000000..5ffa3b8be --- /dev/null +++ b/legacy/doc/models/calculate-loyalty-points-response.md @@ -0,0 +1,46 @@ + +# Calculate Loyalty Points Response + +Represents a [CalculateLoyaltyPoints](../../doc/api/loyalty.md#calculate-loyalty-points) response. + +## Structure + +`CalculateLoyaltyPointsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `points` | `number \| undefined` | Optional | The number of points that the buyer can earn from the base loyalty program. | +| `promotionPoints` | `number \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "points": 6, + "promotion_points": 12, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/calculate-order-request.md b/legacy/doc/models/calculate-order-request.md new file mode 100644 index 000000000..6bc8e0715 --- /dev/null +++ b/legacy/doc/models/calculate-order-request.md @@ -0,0 +1,98 @@ + +# Calculate Order Request + +## Structure + +`CalculateOrderRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `order` | [`Order`](../../doc/models/order.md) | Required | 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. | +| `proposedRewards` | [`OrderReward[] \| null \| undefined`](../../doc/models/order-reward.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "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", + "uid": "uid8", + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note4", + "catalog_object_id": "catalog_object_id2" + }, + { + "base_price_money": { + "amount": 300, + "currency": "USD" + }, + "name": "Item 2", + "quantity": "2", + "uid": "uid8", + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note4", + "catalog_object_id": "catalog_object_id2" + } + ], + "location_id": "D7AVYMEAPJ3A3", + "id": "id6", + "reference_id": "reference_id4", + "source": { + "name": "name4" + }, + "customer_id": "customer_id4" + }, + "proposed_rewards": [ + { + "id": "id0", + "reward_tier_id": "reward_tier_id6" + } + ] +} +``` + diff --git a/legacy/doc/models/calculate-order-response.md b/legacy/doc/models/calculate-order-response.md new file mode 100644 index 000000000..27af1edd0 --- /dev/null +++ b/legacy/doc/models/calculate-order-response.md @@ -0,0 +1,231 @@ + +# Calculate Order Response + +## Structure + +`CalculateOrderResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `order` | [`Order \| undefined`](../../doc/models/order.md) | Optional | 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. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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" + }, + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note4", + "catalog_object_id": "catalog_object_id2" + }, + { + "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" + }, + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note4", + "catalog_object_id": "catalog_object_id2" + } + ], + "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, + "id": "id6", + "reference_id": "reference_id4", + "source": { + "name": "name4" + }, + "customer_id": "customer_id4" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/cancel-booking-request.md b/legacy/doc/models/cancel-booking-request.md new file mode 100644 index 000000000..eacd1c082 --- /dev/null +++ b/legacy/doc/models/cancel-booking-request.md @@ -0,0 +1,23 @@ + +# Cancel Booking Request + +## Structure + +`CancelBookingRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string \| null \| undefined` | Optional | A unique key to make this request an idempotent operation.
**Constraints**: *Maximum Length*: `255` | +| `bookingVersion` | `number \| null \| undefined` | Optional | The revision number for the booking used for optimistic concurrency. | + +## Example (as JSON) + +```json +{ + "idempotency_key": "idempotency_key0", + "booking_version": 224 +} +``` + diff --git a/legacy/doc/models/cancel-booking-response.md b/legacy/doc/models/cancel-booking-response.md new file mode 100644 index 000000000..ab4e4839d --- /dev/null +++ b/legacy/doc/models/cancel-booking-response.md @@ -0,0 +1,42 @@ + +# Cancel Booking Response + +## Structure + +`CancelBookingResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `booking` | [`Booking \| undefined`](../../doc/models/booking.md) | Optional | 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. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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": [] +} +``` + diff --git a/legacy/doc/models/cancel-invoice-request.md b/legacy/doc/models/cancel-invoice-request.md new file mode 100644 index 000000000..0c58a0568 --- /dev/null +++ b/legacy/doc/models/cancel-invoice-request.md @@ -0,0 +1,23 @@ + +# Cancel Invoice Request + +Describes a `CancelInvoice` request. + +## Structure + +`CancelInvoiceRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `version` | `number` | Required | 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). | + +## Example (as JSON) + +```json +{ + "version": 0 +} +``` + diff --git a/legacy/doc/models/cancel-invoice-response.md b/legacy/doc/models/cancel-invoice-response.md new file mode 100644 index 000000000..b15c69fc1 --- /dev/null +++ b/legacy/doc/models/cancel-invoice-response.md @@ -0,0 +1,112 @@ + +# Cancel Invoice Response + +The response returned by the `CancelInvoice` request. + +## Structure + +`CancelInvoiceResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `invoice` | [`Invoice \| undefined`](../../doc/models/invoice.md) | Optional | 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). | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | + +## Example (as JSON) + +```json +{ + "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", + "address": { + "address_line_1": "address_line_16", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "locality": "locality6", + "sublocality": "sublocality6" + } + }, + "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 + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/cancel-loyalty-promotion-response.md b/legacy/doc/models/cancel-loyalty-promotion-response.md new file mode 100644 index 000000000..c934c97a1 --- /dev/null +++ b/legacy/doc/models/cancel-loyalty-promotion-response.md @@ -0,0 +1,81 @@ + +# Cancel Loyalty Promotion Response + +Represents a [CancelLoyaltyPromotion](../../doc/api/loyalty.md#cancel-loyalty-promotion) response. +Either `loyalty_promotion` or `errors` is present in the response. + +## Structure + +`CancelLoyaltyPromotionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `loyaltyPromotion` | [`LoyaltyPromotion \| undefined`](../../doc/models/loyalty-promotion.md) | Optional | Represents a promotion for a [loyalty program](../../doc/models/loyalty-program.md). 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. | + +## Example (as JSON) + +```json +{ + "loyalty_promotion": { + "available_time": { + "start_date": "2022-08-16", + "time_periods": [ + "BEGIN:VEVENT\nDTSTART:20220816T160000\nDURATION:PT2H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT" + ], + "end_date": "end_date8" + }, + "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", + "points_addition_data": { + "points_addition": 218 + } + }, + "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" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/cancel-payment-by-idempotency-key-request.md b/legacy/doc/models/cancel-payment-by-idempotency-key-request.md new file mode 100644 index 000000000..a052b4d29 --- /dev/null +++ b/legacy/doc/models/cancel-payment-by-idempotency-key-request.md @@ -0,0 +1,24 @@ + +# Cancel Payment by Idempotency Key Request + +Describes a request to cancel a payment using +[CancelPaymentByIdempotencyKey](../../doc/api/payments.md#cancel-payment-by-idempotency-key). + +## Structure + +`CancelPaymentByIdempotencyKeyRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string` | Required | The `idempotency_key` identifying the payment to be canceled.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `45` | + +## Example (as JSON) + +```json +{ + "idempotency_key": "a7e36d40-d24b-11e8-b568-0800200c9a66" +} +``` + diff --git a/legacy/doc/models/cancel-payment-by-idempotency-key-response.md b/legacy/doc/models/cancel-payment-by-idempotency-key-response.md new file mode 100644 index 000000000..21000ad26 --- /dev/null +++ b/legacy/doc/models/cancel-payment-by-idempotency-key-response.md @@ -0,0 +1,38 @@ + +# Cancel Payment by Idempotency Key Response + +Defines the response returned by +[CancelPaymentByIdempotencyKey](../../doc/api/payments.md#cancel-payment-by-idempotency-key). +On success, `errors` is empty. + +## Structure + +`CancelPaymentByIdempotencyKeyResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/cancel-payment-response.md b/legacy/doc/models/cancel-payment-response.md new file mode 100644 index 000000000..afdf17760 --- /dev/null +++ b/legacy/doc/models/cancel-payment-response.md @@ -0,0 +1,98 @@ + +# Cancel Payment Response + +Defines the response returned by [CancelPayment](../../doc/api/payments.md#cancel-payment). + +## Structure + +`CancelPaymentResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | +| `payment` | [`Payment \| undefined`](../../doc/models/payment.md) | Optional | Represents a payment processed by the Square API. | + +## Example (as JSON) + +```json +{ + "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" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/cancel-subscription-response.md b/legacy/doc/models/cancel-subscription-response.md new file mode 100644 index 000000000..b5592134a --- /dev/null +++ b/legacy/doc/models/cancel-subscription-response.md @@ -0,0 +1,146 @@ + +# Cancel Subscription Response + +Defines output parameters in a response from the +[CancelSubscription](../../doc/api/subscriptions.md#cancel-subscription) endpoint. + +## Structure + +`CancelSubscriptionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Errors encountered during the request. | +| `subscription` | [`Subscription \| undefined`](../../doc/models/subscription.md) | Optional | Represents a subscription purchased by a customer.

For more information, see
[Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). | +| `actions` | [`SubscriptionAction[] \| undefined`](../../doc/models/subscription-action.md) | Optional | A list of a single `CANCEL` action scheduled for the subscription. | + +## Example (as JSON) + +```json +{ + "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 + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "actions": [ + { + "id": "id8", + "type": "RESUME", + "effective_date": "effective_date8", + "monthly_billing_anchor_date": 186, + "phases": [ + { + "uid": "uid0", + "ordinal": 78, + "order_template_id": "order_template_id2", + "plan_phase_uid": "plan_phase_uid6" + }, + { + "uid": "uid0", + "ordinal": 78, + "order_template_id": "order_template_id2", + "plan_phase_uid": "plan_phase_uid6" + }, + { + "uid": "uid0", + "ordinal": 78, + "order_template_id": "order_template_id2", + "plan_phase_uid": "plan_phase_uid6" + } + ] + }, + { + "id": "id8", + "type": "RESUME", + "effective_date": "effective_date8", + "monthly_billing_anchor_date": 186, + "phases": [ + { + "uid": "uid0", + "ordinal": 78, + "order_template_id": "order_template_id2", + "plan_phase_uid": "plan_phase_uid6" + }, + { + "uid": "uid0", + "ordinal": 78, + "order_template_id": "order_template_id2", + "plan_phase_uid": "plan_phase_uid6" + }, + { + "uid": "uid0", + "ordinal": 78, + "order_template_id": "order_template_id2", + "plan_phase_uid": "plan_phase_uid6" + } + ] + }, + { + "id": "id8", + "type": "RESUME", + "effective_date": "effective_date8", + "monthly_billing_anchor_date": 186, + "phases": [ + { + "uid": "uid0", + "ordinal": 78, + "order_template_id": "order_template_id2", + "plan_phase_uid": "plan_phase_uid6" + }, + { + "uid": "uid0", + "ordinal": 78, + "order_template_id": "order_template_id2", + "plan_phase_uid": "plan_phase_uid6" + }, + { + "uid": "uid0", + "ordinal": 78, + "order_template_id": "order_template_id2", + "plan_phase_uid": "plan_phase_uid6" + } + ] + } + ] +} +``` + diff --git a/legacy/doc/models/cancel-terminal-action-response.md b/legacy/doc/models/cancel-terminal-action-response.md new file mode 100644 index 000000000..5a887a1ec --- /dev/null +++ b/legacy/doc/models/cancel-terminal-action-response.md @@ -0,0 +1,57 @@ + +# Cancel Terminal Action Response + +## Structure + +`CancelTerminalActionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | +| `action` | [`TerminalAction \| undefined`](../../doc/models/terminal-action.md) | Optional | Represents an action processed by the Square Terminal. | + +## Example (as JSON) + +```json +{ + "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" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/cancel-terminal-checkout-response.md b/legacy/doc/models/cancel-terminal-checkout-response.md new file mode 100644 index 000000000..c1ef60704 --- /dev/null +++ b/legacy/doc/models/cancel-terminal-checkout-response.md @@ -0,0 +1,79 @@ + +# Cancel Terminal Checkout Response + +## Structure + +`CancelTerminalCheckoutResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | +| `checkout` | [`TerminalCheckout \| undefined`](../../doc/models/terminal-checkout.md) | Optional | Represents a checkout processed by the Square Terminal. | + +## Example (as JSON) + +```json +{ + "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, + "separate_tip_screen": false, + "custom_tip_field": false, + "tip_percentages": [ + 48 + ], + "smart_tipping": false + }, + "collect_signature": false, + "show_itemized_cart": false + }, + "id": "S1yDlPQx7slqO", + "location_id": "LOCATION_ID", + "reference_id": "id36815", + "status": "CANCELED", + "updated_at": "2020-03-16T15:31:45.787Z", + "note": "note8", + "order_id": "order_id6", + "payment_options": { + "autocomplete": false, + "delay_duration": "delay_duration2", + "accept_partial_authorization": false, + "delay_action": "CANCEL" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/cancel-terminal-refund-response.md b/legacy/doc/models/cancel-terminal-refund-response.md new file mode 100644 index 000000000..4469b1fe5 --- /dev/null +++ b/legacy/doc/models/cancel-terminal-refund-response.md @@ -0,0 +1,69 @@ + +# Cancel Terminal Refund Response + +## Structure + +`CancelTerminalRefundResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | +| `refund` | [`TerminalRefund \| undefined`](../../doc/models/terminal-refund.md) | Optional | Represents a payment refund processed by the Square Terminal. Only supports Interac (Canadian debit network) payment refunds. | + +## Example (as JSON) + +```json +{ + "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", + "refund_id": "refund_id2" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/capture-transaction-response.md b/legacy/doc/models/capture-transaction-response.md new file mode 100644 index 000000000..53215e7e4 --- /dev/null +++ b/legacy/doc/models/capture-transaction-response.md @@ -0,0 +1,31 @@ + +# Capture Transaction Response + +Defines the fields that are included in the response body of +a request to the [CaptureTransaction](api-endpoint:Transactions-CaptureTransaction) endpoint. + +## Structure + +`CaptureTransactionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/card-brand.md b/legacy/doc/models/card-brand.md new file mode 100644 index 000000000..01ab84733 --- /dev/null +++ b/legacy/doc/models/card-brand.md @@ -0,0 +1,28 @@ + +# Card Brand + +Indicates a card's brand, such as `VISA` or `MASTERCARD`. + +## Enumeration + +`CardBrand` + +## Fields + +| Name | +| --- | +| `OTHER_BRAND` | +| `VISA` | +| `MASTERCARD` | +| `AMERICAN_EXPRESS` | +| `DISCOVER` | +| `DISCOVER_DINERS` | +| `JCB` | +| `CHINA_UNIONPAY` | +| `SQUARE_GIFT_CARD` | +| `SQUARE_CAPITAL_CARD` | +| `INTERAC` | +| `EFTPOS` | +| `FELICA` | +| `EBT` | + diff --git a/legacy/doc/models/card-co-brand.md b/legacy/doc/models/card-co-brand.md new file mode 100644 index 000000000..8e5872dac --- /dev/null +++ b/legacy/doc/models/card-co-brand.md @@ -0,0 +1,17 @@ + +# Card Co Brand + +Indicates the brand for a co-branded card. + +## Enumeration + +`CardCoBrand` + +## Fields + +| Name | +| --- | +| `UNKNOWN` | +| `AFTERPAY` | +| `CLEARPAY` | + diff --git a/legacy/doc/models/card-payment-details.md b/legacy/doc/models/card-payment-details.md new file mode 100644 index 000000000..758cdeb3a --- /dev/null +++ b/legacy/doc/models/card-payment-details.md @@ -0,0 +1,48 @@ + +# Card Payment Details + +Reflects the current status of a card payment. Contains only non-confidential information. + +## Structure + +`CardPaymentDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `status` | `string \| null \| undefined` | Optional | The card payment's current state. The state can be AUTHORIZED, CAPTURED, VOIDED, or
FAILED.
**Constraints**: *Maximum Length*: `50` | +| `card` | [`Card \| undefined`](../../doc/models/card.md) | Optional | 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. | +| `entryMethod` | `string \| null \| undefined` | Optional | The method used to enter the card's details for the payment. The method can be
`KEYED`, `SWIPED`, `EMV`, `ON_FILE`, or `CONTACTLESS`.
**Constraints**: *Maximum Length*: `50` | +| `cvvStatus` | `string \| null \| undefined` | Optional | The status code returned from the Card Verification Value (CVV) check. The code can be
`CVV_ACCEPTED`, `CVV_REJECTED`, or `CVV_NOT_CHECKED`.
**Constraints**: *Maximum Length*: `50` | +| `avsStatus` | `string \| null \| undefined` | Optional | The status code returned from the Address Verification System (AVS) check. The code can be
`AVS_ACCEPTED`, `AVS_REJECTED`, or `AVS_NOT_CHECKED`.
**Constraints**: *Maximum Length*: `50` | +| `authResultCode` | `string \| null \| undefined` | Optional | The status code returned by the card issuer that describes the payment's
authorization status.
**Constraints**: *Maximum Length*: `10` | +| `applicationIdentifier` | `string \| null \| undefined` | Optional | For EMV payments, the application ID identifies the EMV application used for the payment.
**Constraints**: *Maximum Length*: `32` | +| `applicationName` | `string \| null \| undefined` | Optional | For EMV payments, the human-readable name of the EMV application used for the payment.
**Constraints**: *Maximum Length*: `16` | +| `applicationCryptogram` | `string \| null \| undefined` | Optional | For EMV payments, the cryptogram generated for the payment.
**Constraints**: *Maximum Length*: `16` | +| `verificationMethod` | `string \| null \| undefined` | Optional | 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`.
**Constraints**: *Maximum Length*: `50` | +| `verificationResults` | `string \| null \| undefined` | Optional | For EMV payments, the results of the cardholder verification. The result can be
`SUCCESS`, `FAILURE`, or `UNKNOWN`.
**Constraints**: *Maximum Length*: `50` | +| `statementDescription` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `50` | +| `deviceDetails` | [`DeviceDetails \| undefined`](../../doc/models/device-details.md) | Optional | Details about the device that took the payment. | +| `cardPaymentTimeline` | [`CardPaymentTimeline \| undefined`](../../doc/models/card-payment-timeline.md) | Optional | The timeline for card payments. | +| `refundRequiresCardPresence` | `boolean \| null \| undefined` | Optional | Whether the card must be physically present for the payment to
be refunded. If set to `true`, the card must be present. | +| `errors` | [`Error[] \| null \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | + +## Example (as JSON) + +```json +{ + "status": "status6", + "card": { + "id": "id6", + "card_brand": "OTHER_BRAND", + "last_4": "last_48", + "exp_month": 228, + "exp_year": 68 + }, + "entry_method": "entry_method8", + "cvv_status": "cvv_status4", + "avs_status": "avs_status6" +} +``` + diff --git a/legacy/doc/models/card-payment-timeline.md b/legacy/doc/models/card-payment-timeline.md new file mode 100644 index 000000000..dc1c881de --- /dev/null +++ b/legacy/doc/models/card-payment-timeline.md @@ -0,0 +1,27 @@ + +# Card Payment Timeline + +The timeline for card payments. + +## Structure + +`CardPaymentTimeline` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `authorizedAt` | `string \| null \| undefined` | Optional | The timestamp when the payment was authorized, in RFC 3339 format. | +| `capturedAt` | `string \| null \| undefined` | Optional | The timestamp when the payment was captured, in RFC 3339 format. | +| `voidedAt` | `string \| null \| undefined` | Optional | The timestamp when the payment was voided, in RFC 3339 format. | + +## Example (as JSON) + +```json +{ + "authorized_at": "authorized_at2", + "captured_at": "captured_at2", + "voided_at": "voided_at6" +} +``` + diff --git a/legacy/doc/models/card-prepaid-type.md b/legacy/doc/models/card-prepaid-type.md new file mode 100644 index 000000000..2e3352df5 --- /dev/null +++ b/legacy/doc/models/card-prepaid-type.md @@ -0,0 +1,17 @@ + +# Card Prepaid Type + +Indicates a card's prepaid type, such as `NOT_PREPAID` or `PREPAID`. + +## Enumeration + +`CardPrepaidType` + +## Fields + +| Name | +| --- | +| `UNKNOWN_PREPAID_TYPE` | +| `NOT_PREPAID` | +| `PREPAID` | + diff --git a/legacy/doc/models/card-type.md b/legacy/doc/models/card-type.md new file mode 100644 index 000000000..97b9f084c --- /dev/null +++ b/legacy/doc/models/card-type.md @@ -0,0 +1,17 @@ + +# Card Type + +Indicates a card's type, such as `CREDIT` or `DEBIT`. + +## Enumeration + +`CardType` + +## Fields + +| Name | +| --- | +| `UNKNOWN_CARD_TYPE` | +| `CREDIT` | +| `DEBIT` | + diff --git a/legacy/doc/models/card.md b/legacy/doc/models/card.md new file mode 100644 index 000000000..99f9ab552 --- /dev/null +++ b/legacy/doc/models/card.md @@ -0,0 +1,44 @@ + +# Card + +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. + +## Structure + +`Card` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | Unique ID for this card. Generated by Square.
**Constraints**: *Maximum Length*: `64` | +| `cardBrand` | [`string \| undefined`](../../doc/models/card-brand.md) | Optional | Indicates a card's brand, such as `VISA` or `MASTERCARD`. | +| `last4` | `string \| undefined` | Optional | The last 4 digits of the card number.
**Constraints**: *Maximum Length*: `4` | +| `expMonth` | `bigint \| null \| undefined` | Optional | The expiration month of the associated card as an integer between 1 and 12. | +| `expYear` | `bigint \| null \| undefined` | Optional | The four-digit year of the card's expiration date. | +| `cardholderName` | `string \| null \| undefined` | Optional | The name of the cardholder.
**Constraints**: *Maximum Length*: `96` | +| `billingAddress` | [`Address \| undefined`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | +| `fingerprint` | `string \| undefined` | Optional | Intended as a Square-assigned identifier, based
on the card number, to identify the card across multiple locations within a
single application.
**Constraints**: *Maximum Length*: `255` | +| `customerId` | `string \| null \| undefined` | Optional | **Required** The ID of a customer created using the Customers API to be associated with the card. | +| `merchantId` | `string \| undefined` | Optional | The ID of the merchant associated with the card. | +| `referenceId` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `128` | +| `enabled` | `boolean \| undefined` | Optional | Indicates whether or not a card can be used for payments. | +| `cardType` | [`string \| undefined`](../../doc/models/card-type.md) | Optional | Indicates a card's type, such as `CREDIT` or `DEBIT`. | +| `prepaidType` | [`string \| undefined`](../../doc/models/card-prepaid-type.md) | Optional | Indicates a card's prepaid type, such as `NOT_PREPAID` or `PREPAID`. | +| `bin` | `string \| undefined` | Optional | The first six digits of the card number, known as the Bank Identification Number (BIN). Only the Payments API
returns this field.
**Constraints**: *Maximum Length*: `6` | +| `version` | `bigint \| undefined` | Optional | 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. | +| `cardCoBrand` | [`string \| undefined`](../../doc/models/card-co-brand.md) | Optional | Indicates the brand for a co-branded card. | + +## Example (as JSON) + +```json +{ + "id": "id0", + "card_brand": "INTERAC", + "last_4": "last_42", + "exp_month": 240, + "exp_year": 56 +} +``` + diff --git a/legacy/doc/models/cash-app-details.md b/legacy/doc/models/cash-app-details.md new file mode 100644 index 000000000..292277e6a --- /dev/null +++ b/legacy/doc/models/cash-app-details.md @@ -0,0 +1,27 @@ + +# Cash App Details + +Additional details about `WALLET` type payments with the `brand` of `CASH_APP`. + +## Structure + +`CashAppDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `buyerFullName` | `string \| null \| undefined` | Optional | The name of the Cash App account holder.
**Constraints**: *Maximum Length*: `255` | +| `buyerCountryCode` | `string \| null \| undefined` | Optional | The country of the Cash App account holder, in ISO 3166-1-alpha-2 format.

For possible values, see [Country](entity:Country).
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `2` | +| `buyerCashtag` | `string \| undefined` | Optional | $Cashtag of the Cash App account holder.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `21` | + +## Example (as JSON) + +```json +{ + "buyer_full_name": "buyer_full_name0", + "buyer_country_code": "buyer_country_code0", + "buyer_cashtag": "buyer_cashtag2" +} +``` + diff --git a/legacy/doc/models/cash-drawer-device.md b/legacy/doc/models/cash-drawer-device.md new file mode 100644 index 000000000..f4f4479d4 --- /dev/null +++ b/legacy/doc/models/cash-drawer-device.md @@ -0,0 +1,23 @@ + +# Cash Drawer Device + +## Structure + +`CashDrawerDevice` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | The device Square-issued ID | +| `name` | `string \| null \| undefined` | Optional | The device merchant-specified name. | + +## Example (as JSON) + +```json +{ + "id": "id2", + "name": "name2" +} +``` + diff --git a/legacy/doc/models/cash-drawer-event-type.md b/legacy/doc/models/cash-drawer-event-type.md new file mode 100644 index 000000000..afb4d4e70 --- /dev/null +++ b/legacy/doc/models/cash-drawer-event-type.md @@ -0,0 +1,25 @@ + +# Cash Drawer Event Type + +The types of events on a CashDrawerShift. +Each event type represents an employee action on the actual cash drawer +represented by a CashDrawerShift. + +## Enumeration + +`CashDrawerEventType` + +## Fields + +| Name | Description | +| --- | --- | +| `NO_SALE` | Triggered when a no sale occurs on a cash drawer.
A CashDrawerEvent of this type must have a zero money amount. | +| `CASH_TENDER_PAYMENT` | Triggered when a cash tender payment occurs on a cash drawer.
A CashDrawerEvent of this type can must not have a negative amount. | +| `OTHER_TENDER_PAYMENT` | Triggered when a check, gift card, or other non-cash payment occurs
on a cash drawer.
A CashDrawerEvent of this type must have a zero money amount. | +| `CASH_TENDER_CANCELLED_PAYMENT` | Triggered when a split tender bill is cancelled after cash has been
tendered.
A CASH_TENDER_CANCELLED_PAYMENT should have a corresponding CASH_TENDER_PAYMENT.
A CashDrawerEvent of this type must not have a negative amount. | +| `OTHER_TENDER_CANCELLED_PAYMENT` | Triggered when a split tender bill is cancelled after a non-cash tender
has been tendered. An OTHER_TENDER_CANCELLED_PAYMENT should have a corresponding
OTHER_TENDER_PAYMENT. A CashDrawerEvent of this type must have a zero money
amount. | +| `CASH_TENDER_REFUND` | Triggered when a cash tender refund occurs.
A CashDrawerEvent of this type must not have a negative amount. | +| `OTHER_TENDER_REFUND` | Triggered when an other tender refund occurs.
A CashDrawerEvent of this type must have a zero money amount. | +| `PAID_IN` | Triggered when money unrelated to a payment is added to the cash drawer.
For example, an employee adds coins to the drawer.
A CashDrawerEvent of this type must not have a negative amount. | +| `PAID_OUT` | Triggered when money is removed from the drawer for other reasons
than making change.
For example, an employee pays a delivery person with cash from the cash drawer.
A CashDrawerEvent of this type must not have a negative amount. | + diff --git a/legacy/doc/models/cash-drawer-shift-event.md b/legacy/doc/models/cash-drawer-shift-event.md new file mode 100644 index 000000000..f4174513d --- /dev/null +++ b/legacy/doc/models/cash-drawer-shift-event.md @@ -0,0 +1,33 @@ + +# Cash Drawer Shift Event + +## Structure + +`CashDrawerShiftEvent` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | The unique ID of the event. | +| `eventType` | [`string \| undefined`](../../doc/models/cash-drawer-event-type.md) | Optional | The types of events on a CashDrawerShift.
Each event type represents an employee action on the actual cash drawer
represented by a CashDrawerShift. | +| `eventMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `createdAt` | `string \| undefined` | Optional | The event time in RFC 3339 format. | +| `description` | `string \| null \| undefined` | Optional | An optional description of the event, entered by the employee that
created the event. | +| `teamMemberId` | `string \| undefined` | Optional | The ID of the team member that created the event. | + +## Example (as JSON) + +```json +{ + "id": "id6", + "event_type": "OTHER_TENDER_PAYMENT", + "event_money": { + "amount": 148, + "currency": "SDG" + }, + "created_at": "created_at4", + "description": "description6" +} +``` + diff --git a/legacy/doc/models/cash-drawer-shift-state.md b/legacy/doc/models/cash-drawer-shift-state.md new file mode 100644 index 000000000..7c9e3dbb0 --- /dev/null +++ b/legacy/doc/models/cash-drawer-shift-state.md @@ -0,0 +1,17 @@ + +# Cash Drawer Shift State + +The current state of a cash drawer shift. + +## Enumeration + +`CashDrawerShiftState` + +## Fields + +| Name | Description | +| --- | --- | +| `OPEN` | An open cash drawer shift. | +| `ENDED` | A cash drawer shift that is ended but has not yet had an employee content audit. | +| `CLOSED` | An ended cash drawer shift that is closed with a completed employee
content audit and recorded result. | + diff --git a/legacy/doc/models/cash-drawer-shift-summary.md b/legacy/doc/models/cash-drawer-shift-summary.md new file mode 100644 index 000000000..6be35eebf --- /dev/null +++ b/legacy/doc/models/cash-drawer-shift-summary.md @@ -0,0 +1,41 @@ + +# Cash Drawer Shift Summary + +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. + +## Structure + +`CashDrawerShiftSummary` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | The shift unique ID. | +| `state` | [`string \| undefined`](../../doc/models/cash-drawer-shift-state.md) | Optional | The current state of a cash drawer shift. | +| `openedAt` | `string \| null \| undefined` | Optional | The shift start time in ISO 8601 format. | +| `endedAt` | `string \| null \| undefined` | Optional | The shift end time in ISO 8601 format. | +| `closedAt` | `string \| null \| undefined` | Optional | The shift close time in ISO 8601 format. | +| `description` | `string \| null \| undefined` | Optional | An employee free-text description of a cash drawer shift. | +| `openedCashMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `expectedCashMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `closedCashMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `createdAt` | `string \| undefined` | Optional | The shift start time in RFC 3339 format. | +| `updatedAt` | `string \| undefined` | Optional | The shift updated at time in RFC 3339 format. | +| `locationId` | `string \| undefined` | Optional | The ID of the location the cash drawer shift belongs to. | + +## Example (as JSON) + +```json +{ + "id": "id0", + "state": "CLOSED", + "opened_at": "opened_at8", + "ended_at": "ended_at2", + "closed_at": "closed_at2" +} +``` + diff --git a/legacy/doc/models/cash-drawer-shift.md b/legacy/doc/models/cash-drawer-shift.md new file mode 100644 index 000000000..759b73331 --- /dev/null +++ b/legacy/doc/models/cash-drawer-shift.md @@ -0,0 +1,50 @@ + +# Cash Drawer Shift + +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. + +## Structure + +`CashDrawerShift` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | The shift unique ID. | +| `state` | [`string \| undefined`](../../doc/models/cash-drawer-shift-state.md) | Optional | The current state of a cash drawer shift. | +| `openedAt` | `string \| null \| undefined` | Optional | The time when the shift began, in ISO 8601 format. | +| `endedAt` | `string \| null \| undefined` | Optional | The time when the shift ended, in ISO 8601 format. | +| `closedAt` | `string \| null \| undefined` | Optional | The time when the shift was closed, in ISO 8601 format. | +| `description` | `string \| null \| undefined` | Optional | The free-form text description of a cash drawer by an employee. | +| `openedCashMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `cashPaymentMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `cashRefundsMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `cashPaidInMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `cashPaidOutMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `expectedCashMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `closedCashMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `device` | [`CashDrawerDevice \| undefined`](../../doc/models/cash-drawer-device.md) | Optional | - | +| `createdAt` | `string \| undefined` | Optional | The shift start time in RFC 3339 format. | +| `updatedAt` | `string \| undefined` | Optional | The shift updated at time in RFC 3339 format. | +| `locationId` | `string \| undefined` | Optional | The ID of the location the cash drawer shift belongs to. | +| `teamMemberIds` | `string[] \| undefined` | Optional | The IDs of all team members that were logged into Square Point of Sale at any
point while the cash drawer shift was open. | +| `openingTeamMemberId` | `string \| undefined` | Optional | The ID of the team member that started the cash drawer shift. | +| `endingTeamMemberId` | `string \| undefined` | Optional | The ID of the team member that ended the cash drawer shift. | +| `closingTeamMemberId` | `string \| undefined` | Optional | The ID of the team member that closed the cash drawer shift by auditing
the cash drawer contents. | + +## Example (as JSON) + +```json +{ + "id": "id6", + "state": "OPEN", + "opened_at": "opened_at4", + "ended_at": "ended_at8", + "closed_at": "closed_at8" +} +``` + diff --git a/legacy/doc/models/cash-payment-details.md b/legacy/doc/models/cash-payment-details.md new file mode 100644 index 000000000..4e387bb63 --- /dev/null +++ b/legacy/doc/models/cash-payment-details.md @@ -0,0 +1,32 @@ + +# Cash Payment Details + +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). + +## Structure + +`CashPaymentDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `buyerSuppliedMoney` | [`Money`](../../doc/models/money.md) | Required | 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. | +| `changeBackMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "buyer_supplied_money": { + "amount": 114, + "currency": "XTS" + }, + "change_back_money": { + "amount": 78, + "currency": "XBD" + } +} +``` + diff --git a/legacy/doc/models/catalog-availability-period.md b/legacy/doc/models/catalog-availability-period.md new file mode 100644 index 000000000..dbbd6ddf4 --- /dev/null +++ b/legacy/doc/models/catalog-availability-period.md @@ -0,0 +1,27 @@ + +# Catalog Availability Period + +Represents a time period of availability. + +## Structure + +`CatalogAvailabilityPeriod` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `startLocalTime` | `string \| null \| undefined` | Optional | 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. | +| `endLocalTime` | `string \| null \| undefined` | Optional | 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. | +| `dayOfWeek` | [`string \| undefined`](../../doc/models/day-of-week.md) | Optional | Indicates the specific day of the week. | + +## Example (as JSON) + +```json +{ + "start_local_time": "start_local_time6", + "end_local_time": "end_local_time8", + "day_of_week": "WED" +} +``` + diff --git a/legacy/doc/models/catalog-category-type.md b/legacy/doc/models/catalog-category-type.md new file mode 100644 index 000000000..6d70fc37d --- /dev/null +++ b/legacy/doc/models/catalog-category-type.md @@ -0,0 +1,17 @@ + +# Catalog Category Type + +Indicates the type of a category. + +## Enumeration + +`CatalogCategoryType` + +## Fields + +| Name | Description | +| --- | --- | +| `REGULAR_CATEGORY` | The regular category. | +| `MENU_CATEGORY` | The menu category. | +| `KITCHEN_CATEGORY` | Kitchen categories are used by KDS (Kitchen Display System) to route items to specific clients | + diff --git a/legacy/doc/models/catalog-category.md b/legacy/doc/models/catalog-category.md new file mode 100644 index 000000000..783fc2479 --- /dev/null +++ b/legacy/doc/models/catalog-category.md @@ -0,0 +1,52 @@ + +# Catalog Category + +A category to which a `CatalogItem` instance belongs. + +## Structure + +`CatalogCategory` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `string \| null \| undefined` | Optional | The category name. This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points.
**Constraints**: *Maximum Length*: `255` | +| `imageIds` | `string[] \| null \| undefined` | Optional | 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. | +| `categoryType` | [`string \| undefined`](../../doc/models/catalog-category-type.md) | Optional | Indicates the type of a category. | +| `parentCategory` | [`CatalogObjectCategory \| undefined`](../../doc/models/catalog-object-category.md) | Optional | 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. | +| `isTopLevel` | `boolean \| null \| undefined` | Optional | Indicates whether a category is a top level category, which does not have any parent_category. | +| `channels` | `string[] \| null \| undefined` | Optional | A list of IDs representing channels, such as a Square Online site, where the category can be made visible. | +| `availabilityPeriodIds` | `string[] \| null \| undefined` | Optional | The IDs of the `CatalogAvailabilityPeriod` objects associated with the category. | +| `onlineVisibility` | `boolean \| null \| undefined` | Optional | Indicates whether the category is visible (`true`) or hidden (`false`) on all of the seller's Square Online sites. | +| `rootCategory` | `string \| undefined` | Optional | The top-level category in a category hierarchy. | +| `ecomSeoData` | [`CatalogEcomSeoData \| undefined`](../../doc/models/catalog-ecom-seo-data.md) | Optional | SEO data for for a seller's Square Online store. | +| `pathToRoot` | [`CategoryPathToRootNode[] \| null \| undefined`](../../doc/models/category-path-to-root-node.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "object": { + "category_data": { + "name": "Beverages" + }, + "id": "#Beverages", + "present_at_all_locations": true, + "type": "CATEGORY" + }, + "name": "name2", + "image_ids": [ + "image_ids7", + "image_ids6", + "image_ids5" + ], + "category_type": "REGULAR_CATEGORY", + "parent_category": { + "id": "id4", + "ordinal": 114 + }, + "is_top_level": false +} +``` + diff --git a/legacy/doc/models/catalog-custom-attribute-definition-app-visibility.md b/legacy/doc/models/catalog-custom-attribute-definition-app-visibility.md new file mode 100644 index 000000000..1e1bca2d3 --- /dev/null +++ b/legacy/doc/models/catalog-custom-attribute-definition-app-visibility.md @@ -0,0 +1,18 @@ + +# Catalog Custom Attribute Definition App Visibility + +Defines the visibility of a custom attribute to applications other than their +creating application. + +## Enumeration + +`CatalogCustomAttributeDefinitionAppVisibility` + +## Fields + +| Name | Description | +| --- | --- | +| `APP_VISIBILITY_HIDDEN` | Other applications cannot read this custom attribute. | +| `APP_VISIBILITY_READ_ONLY` | Other applications can read this custom attribute definition and
values. | +| `APP_VISIBILITY_READ_WRITE_VALUES` | Other applications can read and write custom attribute values on objects.
They can read but cannot edit the custom attribute definition. | + diff --git a/legacy/doc/models/catalog-custom-attribute-definition-number-config.md b/legacy/doc/models/catalog-custom-attribute-definition-number-config.md new file mode 100644 index 000000000..f4580169a --- /dev/null +++ b/legacy/doc/models/catalog-custom-attribute-definition-number-config.md @@ -0,0 +1,21 @@ + +# Catalog Custom Attribute Definition Number Config + +## Structure + +`CatalogCustomAttributeDefinitionNumberConfig` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `precision` | `number \| null \| undefined` | Optional | 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
**Constraints**: `<= 5` | + +## Example (as JSON) + +```json +{ + "precision": 208 +} +``` + diff --git a/legacy/doc/models/catalog-custom-attribute-definition-selection-config-custom-attribute-selection.md b/legacy/doc/models/catalog-custom-attribute-definition-selection-config-custom-attribute-selection.md new file mode 100644 index 000000000..f627a6f04 --- /dev/null +++ b/legacy/doc/models/catalog-custom-attribute-definition-selection-config-custom-attribute-selection.md @@ -0,0 +1,25 @@ + +# Catalog Custom Attribute Definition Selection Config Custom Attribute Selection + +A named selection for this `SELECTION`-type custom attribute definition. + +## Structure + +`CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string \| null \| undefined` | Optional | Unique ID set by Square. | +| `name` | `string` | Required | Selection name, unique within `allowed_selections`.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | + +## Example (as JSON) + +```json +{ + "uid": "uid4", + "name": "name4" +} +``` + diff --git a/legacy/doc/models/catalog-custom-attribute-definition-selection-config.md b/legacy/doc/models/catalog-custom-attribute-definition-selection-config.md new file mode 100644 index 000000000..ff113e4a4 --- /dev/null +++ b/legacy/doc/models/catalog-custom-attribute-definition-selection-config.md @@ -0,0 +1,38 @@ + +# Catalog Custom Attribute Definition Selection Config + +Configuration associated with `SELECTION`-type custom attribute definitions. + +## Structure + +`CatalogCustomAttributeDefinitionSelectionConfig` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `maxAllowedSelections` | `number \| null \| undefined` | Optional | 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.
**Constraints**: `<= 100` | +| `allowedSelections` | [`CatalogCustomAttributeDefinitionSelectionConfigCustomAttributeSelection[] \| null \| undefined`](../../doc/models/catalog-custom-attribute-definition-selection-config-custom-attribute-selection.md) | Optional | The set of valid `CatalogCustomAttributeSelections`. Up to a maximum of 100
selections can be defined. Can be modified. | + +## Example (as JSON) + +```json +{ + "max_allowed_selections": 124, + "allowed_selections": [ + { + "uid": "uid0", + "name": "name0" + }, + { + "uid": "uid0", + "name": "name0" + }, + { + "uid": "uid0", + "name": "name0" + } + ] +} +``` + diff --git a/legacy/doc/models/catalog-custom-attribute-definition-seller-visibility.md b/legacy/doc/models/catalog-custom-attribute-definition-seller-visibility.md new file mode 100644 index 000000000..fb20e292b --- /dev/null +++ b/legacy/doc/models/catalog-custom-attribute-definition-seller-visibility.md @@ -0,0 +1,18 @@ + +# Catalog Custom Attribute Definition Seller Visibility + +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). + +## Enumeration + +`CatalogCustomAttributeDefinitionSellerVisibility` + +## Fields + +| Name | Description | +| --- | --- | +| `SELLER_VISIBILITY_HIDDEN` | Sellers cannot read this custom attribute in Square client
applications or Square APIs. | +| `SELLER_VISIBILITY_READ_WRITE_VALUES` | Sellers can read and write this custom attribute value in catalog objects,
but cannot edit the custom attribute definition. | + diff --git a/legacy/doc/models/catalog-custom-attribute-definition-string-config.md b/legacy/doc/models/catalog-custom-attribute-definition-string-config.md new file mode 100644 index 000000000..f6d4f8a25 --- /dev/null +++ b/legacy/doc/models/catalog-custom-attribute-definition-string-config.md @@ -0,0 +1,23 @@ + +# Catalog Custom Attribute Definition String Config + +Configuration associated with Custom Attribute Definitions of type `STRING`. + +## Structure + +`CatalogCustomAttributeDefinitionStringConfig` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `enforceUniqueness` | `boolean \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "enforce_uniqueness": false +} +``` + diff --git a/legacy/doc/models/catalog-custom-attribute-definition-type.md b/legacy/doc/models/catalog-custom-attribute-definition-type.md new file mode 100644 index 000000000..7d5c56bd5 --- /dev/null +++ b/legacy/doc/models/catalog-custom-attribute-definition-type.md @@ -0,0 +1,18 @@ + +# Catalog Custom Attribute Definition Type + +Defines the possible types for a custom attribute. + +## Enumeration + +`CatalogCustomAttributeDefinitionType` + +## Fields + +| Name | Description | +| --- | --- | +| `STRING` | A free-form string containing up to 255 characters. | +| `BOOLEAN` | A `true` or `false` value. | +| `NUMBER` | A decimal string representation of a number. Can support up to 5 digits after the decimal point. | +| `SELECTION` | One or more choices from `allowed_selections`. | + diff --git a/legacy/doc/models/catalog-custom-attribute-definition.md b/legacy/doc/models/catalog-custom-attribute-definition.md new file mode 100644 index 000000000..7e44ff5d1 --- /dev/null +++ b/legacy/doc/models/catalog-custom-attribute-definition.md @@ -0,0 +1,54 @@ + +# Catalog Custom Attribute Definition + +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) + +## Structure + +`CatalogCustomAttributeDefinition` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `type` | [`string`](../../doc/models/catalog-custom-attribute-definition-type.md) | Required | Defines the possible types for a custom attribute. | +| `name` | `string` | Required | 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.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | +| `description` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `255` | +| `sourceApplication` | [`SourceApplication \| undefined`](../../doc/models/source-application.md) | Optional | Represents information about the application used to generate a change. | +| `allowedObjectTypes` | [`string[]`](../../doc/models/catalog-object-type.md) | Required | 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 | +| `sellerVisibility` | [`string \| undefined`](../../doc/models/catalog-custom-attribute-definition-seller-visibility.md) | Optional | 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). | +| `appVisibility` | [`string \| undefined`](../../doc/models/catalog-custom-attribute-definition-app-visibility.md) | Optional | Defines the visibility of a custom attribute to applications other than their
creating application. | +| `stringConfig` | [`CatalogCustomAttributeDefinitionStringConfig \| undefined`](../../doc/models/catalog-custom-attribute-definition-string-config.md) | Optional | Configuration associated with Custom Attribute Definitions of type `STRING`. | +| `numberConfig` | [`CatalogCustomAttributeDefinitionNumberConfig \| undefined`](../../doc/models/catalog-custom-attribute-definition-number-config.md) | Optional | - | +| `selectionConfig` | [`CatalogCustomAttributeDefinitionSelectionConfig \| undefined`](../../doc/models/catalog-custom-attribute-definition-selection-config.md) | Optional | Configuration associated with `SELECTION`-type custom attribute definitions. | +| `customAttributeUsageCount` | `number \| undefined` | Optional | 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`. | +| `key` | `string \| null \| undefined` | Optional | 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_-]`.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `60`, *Pattern*: `^[a-zA-Z0-9_-]*$` | + +## Example (as JSON) + +```json +{ + "type": "STRING", + "name": "name0", + "description": "description0", + "source_application": { + "product": "BILLING", + "application_id": "application_id8", + "name": "name2" + }, + "allowed_object_types": [ + "CATEGORY", + "IMAGE" + ], + "seller_visibility": "SELLER_VISIBILITY_HIDDEN", + "app_visibility": "APP_VISIBILITY_HIDDEN", + "string_config": { + "enforce_uniqueness": false + } +} +``` + diff --git a/legacy/doc/models/catalog-custom-attribute-value.md b/legacy/doc/models/catalog-custom-attribute-value.md new file mode 100644 index 000000000..d4c1e3eee --- /dev/null +++ b/legacy/doc/models/catalog-custom-attribute-value.md @@ -0,0 +1,36 @@ + +# Catalog Custom Attribute Value + +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). + +## Structure + +`CatalogCustomAttributeValue` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `string \| null \| undefined` | Optional | The name of the custom attribute. | +| `stringValue` | `string \| null \| undefined` | Optional | The string value of the custom attribute. Populated if `type` = `STRING`. | +| `customAttributeDefinitionId` | `string \| undefined` | Optional | The id of the [CatalogCustomAttributeDefinition](entity:CatalogCustomAttributeDefinition) this value belongs to. | +| `type` | [`string \| undefined`](../../doc/models/catalog-custom-attribute-definition-type.md) | Optional | Defines the possible types for a custom attribute. | +| `numberValue` | `string \| null \| undefined` | Optional | Populated if `type` = `NUMBER`. Contains a string
representation of a decimal number, using a `.` as the decimal separator. | +| `booleanValue` | `boolean \| null \| undefined` | Optional | A `true` or `false` value. Populated if `type` = `BOOLEAN`. | +| `selectionUidValues` | `string[] \| null \| undefined` | Optional | One or more choices from `allowed_selections`. Populated if `type` = `SELECTION`. | +| `key` | `string \| undefined` | Optional | 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". | + +## Example (as JSON) + +```json +{ + "name": "name2", + "string_value": "string_value6", + "custom_attribute_definition_id": "custom_attribute_definition_id0", + "type": "NUMBER", + "number_value": "number_value2" +} +``` + diff --git a/legacy/doc/models/catalog-discount-modify-tax-basis.md b/legacy/doc/models/catalog-discount-modify-tax-basis.md new file mode 100644 index 000000000..755c9fe22 --- /dev/null +++ b/legacy/doc/models/catalog-discount-modify-tax-basis.md @@ -0,0 +1,14 @@ + +# Catalog Discount Modify Tax Basis + +## Enumeration + +`CatalogDiscountModifyTaxBasis` + +## Fields + +| Name | Description | +| --- | --- | +| `MODIFY_TAX_BASIS` | Application of the discount will modify the tax basis. | +| `DO_NOT_MODIFY_TAX_BASIS` | Application of the discount will not modify the tax basis. | + diff --git a/legacy/doc/models/catalog-discount-type.md b/legacy/doc/models/catalog-discount-type.md new file mode 100644 index 000000000..5eae92154 --- /dev/null +++ b/legacy/doc/models/catalog-discount-type.md @@ -0,0 +1,18 @@ + +# Catalog Discount Type + +How to apply a CatalogDiscount to a CatalogItem. + +## Enumeration + +`CatalogDiscountType` + +## Fields + +| Name | Description | +| --- | --- | +| `FIXED_PERCENTAGE` | Apply the discount as a fixed percentage (e.g., 5%) off the item price. | +| `FIXED_AMOUNT` | Apply the discount as a fixed amount (e.g., $1.00) off the item price. | +| `VARIABLE_PERCENTAGE` | Apply the discount as a variable percentage off the item price. The percentage will be specified at the time of sale. | +| `VARIABLE_AMOUNT` | Apply the discount as a variable amount off the item price. The amount will be specified at the time of sale. | + diff --git a/legacy/doc/models/catalog-discount.md b/legacy/doc/models/catalog-discount.md new file mode 100644 index 000000000..48557096f --- /dev/null +++ b/legacy/doc/models/catalog-discount.md @@ -0,0 +1,49 @@ + +# Catalog Discount + +A discount applicable to items. + +## Structure + +`CatalogDiscount` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `string \| null \| undefined` | Optional | The discount name. This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points.
**Constraints**: *Maximum Length*: `255` | +| `discountType` | [`string \| undefined`](../../doc/models/catalog-discount-type.md) | Optional | How to apply a CatalogDiscount to a CatalogItem. | +| `percentage` | `string \| null \| undefined` | Optional | 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. | +| `amountMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `pinRequired` | `boolean \| null \| undefined` | Optional | 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. | +| `labelColor` | `string \| null \| undefined` | Optional | The color of the discount display label in the Square Point of Sale app. This must be a valid hex color code. | +| `modifyTaxBasis` | [`string \| undefined`](../../doc/models/catalog-discount-modify-tax-basis.md) | Optional | - | +| `maximumAmountMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "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" + }, + "name": "name8", + "discount_type": "VARIABLE_PERCENTAGE", + "percentage": "percentage6", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "pin_required": false +} +``` + diff --git a/legacy/doc/models/catalog-ecom-seo-data.md b/legacy/doc/models/catalog-ecom-seo-data.md new file mode 100644 index 000000000..5e97aabcb --- /dev/null +++ b/legacy/doc/models/catalog-ecom-seo-data.md @@ -0,0 +1,27 @@ + +# Catalog Ecom Seo Data + +SEO data for for a seller's Square Online store. + +## Structure + +`CatalogEcomSeoData` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `pageTitle` | `string \| null \| undefined` | Optional | The SEO title used for the Square Online store. | +| `pageDescription` | `string \| null \| undefined` | Optional | The SEO description used for the Square Online store. | +| `permalink` | `string \| null \| undefined` | Optional | The SEO permalink used for the Square Online store. | + +## Example (as JSON) + +```json +{ + "page_title": "page_title6", + "page_description": "page_description2", + "permalink": "permalink0" +} +``` + diff --git a/legacy/doc/models/catalog-id-mapping.md b/legacy/doc/models/catalog-id-mapping.md new file mode 100644 index 000000000..7f90ddab5 --- /dev/null +++ b/legacy/doc/models/catalog-id-mapping.md @@ -0,0 +1,35 @@ + +# Catalog Id Mapping + +A mapping between a temporary client-supplied ID and a permanent server-generated ID. + +When calling [UpsertCatalogObject](../../doc/api/catalog.md#upsert-catalog-object) or +[BatchUpsertCatalogObjects](../../doc/api/catalog.md#batch-upsert-catalog-objects) to +create a [CatalogObject](../../doc/models/catalog-object.md) 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. + +## Structure + +`CatalogIdMapping` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `clientObjectId` | `string \| null \| undefined` | Optional | The client-supplied temporary `#`-prefixed ID for a new `CatalogObject`. | +| `objectId` | `string \| null \| undefined` | Optional | The permanent ID for the CatalogObject created by the server. | + +## Example (as JSON) + +```json +{ + "client_object_id": "client_object_id8", + "object_id": "object_id0" +} +``` + diff --git a/legacy/doc/models/catalog-image.md b/legacy/doc/models/catalog-image.md new file mode 100644 index 000000000..4a2c01b13 --- /dev/null +++ b/legacy/doc/models/catalog-image.md @@ -0,0 +1,34 @@ + +# Catalog Image + +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. + +## Structure + +`CatalogImage` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `string \| null \| undefined` | Optional | 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` | `string \| null \| undefined` | Optional | 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` | `string \| null \| undefined` | Optional | 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). | +| `photoStudioOrderId` | `string \| null \| undefined` | Optional | The immutable order ID for this image object created by the Photo Studio service in Square Online Store. | + +## Example (as JSON) + +```json +{ + "name": "name0", + "url": "url4", + "caption": "caption4", + "photo_studio_order_id": "photo_studio_order_id2" +} +``` + diff --git a/legacy/doc/models/catalog-info-response-limits.md b/legacy/doc/models/catalog-info-response-limits.md new file mode 100644 index 000000000..8745250e4 --- /dev/null +++ b/legacy/doc/models/catalog-info-response-limits.md @@ -0,0 +1,35 @@ + +# Catalog Info Response Limits + +## Structure + +`CatalogInfoResponseLimits` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `batchUpsertMaxObjectsPerBatch` | `number \| null \| undefined` | Optional | The maximum number of objects that may appear within a single batch in a
`/v2/catalog/batch-upsert` request. | +| `batchUpsertMaxTotalObjects` | `number \| null \| undefined` | Optional | The maximum number of objects that may appear across all batches in a
`/v2/catalog/batch-upsert` request. | +| `batchRetrieveMaxObjectIds` | `number \| null \| undefined` | Optional | The maximum number of object IDs that may appear in a `/v2/catalog/batch-retrieve`
request. | +| `searchMaxPageLimit` | `number \| null \| undefined` | Optional | The maximum number of results that may be returned in a page of a
`/v2/catalog/search` response. | +| `batchDeleteMaxObjectIds` | `number \| null \| undefined` | Optional | The maximum number of object IDs that may be included in a single
`/v2/catalog/batch-delete` request. | +| `updateItemTaxesMaxItemIds` | `number \| null \| undefined` | Optional | The maximum number of item IDs that may be included in a single
`/v2/catalog/update-item-taxes` request. | +| `updateItemTaxesMaxTaxesToEnable` | `number \| null \| undefined` | Optional | The maximum number of tax IDs to be enabled that may be included in a single
`/v2/catalog/update-item-taxes` request. | +| `updateItemTaxesMaxTaxesToDisable` | `number \| null \| undefined` | Optional | The maximum number of tax IDs to be disabled that may be included in a single
`/v2/catalog/update-item-taxes` request. | +| `updateItemModifierListsMaxItemIds` | `number \| null \| undefined` | Optional | The maximum number of item IDs that may be included in a single
`/v2/catalog/update-item-modifier-lists` request. | +| `updateItemModifierListsMaxModifierListsToEnable` | `number \| null \| undefined` | Optional | The maximum number of modifier list IDs to be enabled that may be included in
a single `/v2/catalog/update-item-modifier-lists` request. | +| `updateItemModifierListsMaxModifierListsToDisable` | `number \| null \| undefined` | Optional | The maximum number of modifier list IDs to be disabled that may be included in
a single `/v2/catalog/update-item-modifier-lists` request. | + +## Example (as JSON) + +```json +{ + "batch_upsert_max_objects_per_batch": 206, + "batch_upsert_max_total_objects": 122, + "batch_retrieve_max_object_ids": 54, + "search_max_page_limit": 144, + "batch_delete_max_object_ids": 40 +} +``` + diff --git a/legacy/doc/models/catalog-info-response.md b/legacy/doc/models/catalog-info-response.md new file mode 100644 index 000000000..9d6c906c7 --- /dev/null +++ b/legacy/doc/models/catalog-info-response.md @@ -0,0 +1,76 @@ + +# Catalog Info Response + +## Structure + +`CatalogInfoResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `limits` | [`CatalogInfoResponseLimits \| undefined`](../../doc/models/catalog-info-response-limits.md) | Optional | - | +| `standardUnitDescriptionGroup` | [`StandardUnitDescriptionGroup \| undefined`](../../doc/models/standard-unit-description-group.md) | Optional | Group of standard measurement units. | + +## Example (as JSON) + +```json +{ + "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 + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "standard_unit_description_group": { + "standard_unit_descriptions": [ + { + "unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_MILLILITER", + "weight_unit": "IMPERIAL_STONE" + }, + "name": "name4", + "abbreviation": "abbreviation6" + }, + { + "unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_MILLILITER", + "weight_unit": "IMPERIAL_STONE" + }, + "name": "name4", + "abbreviation": "abbreviation6" + } + ], + "language_code": "language_code6" + } +} +``` + diff --git a/legacy/doc/models/catalog-item-food-and-beverage-details-dietary-preference-standard-dietary-preference.md b/legacy/doc/models/catalog-item-food-and-beverage-details-dietary-preference-standard-dietary-preference.md new file mode 100644 index 000000000..5e8f24011 --- /dev/null +++ b/legacy/doc/models/catalog-item-food-and-beverage-details-dietary-preference-standard-dietary-preference.md @@ -0,0 +1,21 @@ + +# Catalog Item Food and Beverage Details Dietary Preference Standard Dietary Preference + +Standard dietary preferences for food and beverage items that are recommended on item creation. + +## Enumeration + +`CatalogItemFoodAndBeverageDetailsDietaryPreferenceStandardDietaryPreference` + +## Fields + +| Name | +| --- | +| `DAIRY_FREE` | +| `GLUTEN_FREE` | +| `HALAL` | +| `KOSHER` | +| `NUT_FREE` | +| `VEGAN` | +| `VEGETARIAN` | + diff --git a/legacy/doc/models/catalog-item-food-and-beverage-details-dietary-preference-type.md b/legacy/doc/models/catalog-item-food-and-beverage-details-dietary-preference-type.md new file mode 100644 index 000000000..8f40ee6bc --- /dev/null +++ b/legacy/doc/models/catalog-item-food-and-beverage-details-dietary-preference-type.md @@ -0,0 +1,16 @@ + +# Catalog Item Food and Beverage Details Dietary Preference Type + +The type of dietary preference for the `FOOD_AND_BEV` type of items and integredients. + +## Enumeration + +`CatalogItemFoodAndBeverageDetailsDietaryPreferenceType` + +## Fields + +| Name | Description | +| --- | --- | +| `STANDARD` | A standard value from a pre-determined list. | +| `CUSTOM` | A user-defined custom value. | + diff --git a/legacy/doc/models/catalog-item-food-and-beverage-details-dietary-preference.md b/legacy/doc/models/catalog-item-food-and-beverage-details-dietary-preference.md new file mode 100644 index 000000000..7ace4ac57 --- /dev/null +++ b/legacy/doc/models/catalog-item-food-and-beverage-details-dietary-preference.md @@ -0,0 +1,27 @@ + +# Catalog Item Food and Beverage Details Dietary Preference + +Dietary preferences that can be assigned to an `FOOD_AND_BEV` item and its ingredients. + +## Structure + +`CatalogItemFoodAndBeverageDetailsDietaryPreference` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `type` | [`string \| undefined`](../../doc/models/catalog-item-food-and-beverage-details-dietary-preference-type.md) | Optional | The type of dietary preference for the `FOOD_AND_BEV` type of items and integredients. | +| `standardName` | [`string \| undefined`](../../doc/models/catalog-item-food-and-beverage-details-dietary-preference-standard-dietary-preference.md) | Optional | Standard dietary preferences for food and beverage items that are recommended on item creation. | +| `customName` | `string \| null \| undefined` | Optional | The name of a user-defined custom dietary preference. This should be null if it's a standard dietary preference. | + +## Example (as JSON) + +```json +{ + "type": "STANDARD", + "standard_name": "GLUTEN_FREE", + "custom_name": "custom_name4" +} +``` + diff --git a/legacy/doc/models/catalog-item-food-and-beverage-details-ingredient-standard-ingredient.md b/legacy/doc/models/catalog-item-food-and-beverage-details-ingredient-standard-ingredient.md new file mode 100644 index 000000000..d5275f455 --- /dev/null +++ b/legacy/doc/models/catalog-item-food-and-beverage-details-ingredient-standard-ingredient.md @@ -0,0 +1,28 @@ + +# Catalog Item Food and Beverage Details Ingredient Standard Ingredient + +Standard ingredients for food and beverage items that are recommended on item creation. + +## Enumeration + +`CatalogItemFoodAndBeverageDetailsIngredientStandardIngredient` + +## Fields + +| Name | +| --- | +| `CELERY` | +| `CRUSTACEANS` | +| `EGGS` | +| `FISH` | +| `GLUTEN` | +| `LUPIN` | +| `MILK` | +| `MOLLUSCS` | +| `MUSTARD` | +| `PEANUTS` | +| `SESAME` | +| `SOY` | +| `SULPHITES` | +| `TREE_NUTS` | + diff --git a/legacy/doc/models/catalog-item-food-and-beverage-details-ingredient.md b/legacy/doc/models/catalog-item-food-and-beverage-details-ingredient.md new file mode 100644 index 000000000..731a130a2 --- /dev/null +++ b/legacy/doc/models/catalog-item-food-and-beverage-details-ingredient.md @@ -0,0 +1,27 @@ + +# Catalog Item Food and Beverage Details Ingredient + +Describes the ingredient used in a `FOOD_AND_BEV` item. + +## Structure + +`CatalogItemFoodAndBeverageDetailsIngredient` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `type` | [`string \| undefined`](../../doc/models/catalog-item-food-and-beverage-details-dietary-preference-type.md) | Optional | The type of dietary preference for the `FOOD_AND_BEV` type of items and integredients. | +| `standardName` | [`string \| undefined`](../../doc/models/catalog-item-food-and-beverage-details-ingredient-standard-ingredient.md) | Optional | Standard ingredients for food and beverage items that are recommended on item creation. | +| `customName` | `string \| null \| undefined` | Optional | The name of a custom user-defined ingredient. This should be null if it's a standard dietary preference. | + +## Example (as JSON) + +```json +{ + "type": "STANDARD", + "standard_name": "GLUTEN", + "custom_name": "custom_name6" +} +``` + diff --git a/legacy/doc/models/catalog-item-food-and-beverage-details.md b/legacy/doc/models/catalog-item-food-and-beverage-details.md new file mode 100644 index 000000000..acf99806e --- /dev/null +++ b/legacy/doc/models/catalog-item-food-and-beverage-details.md @@ -0,0 +1,44 @@ + +# Catalog Item Food and Beverage Details + +The food and beverage-specific details of a `FOOD_AND_BEV` item. + +## Structure + +`CatalogItemFoodAndBeverageDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `calorieCount` | `number \| null \| undefined` | Optional | The calorie count (in the unit of kcal) for the `FOOD_AND_BEV` type of items. | +| `dietaryPreferences` | [`CatalogItemFoodAndBeverageDetailsDietaryPreference[] \| null \| undefined`](../../doc/models/catalog-item-food-and-beverage-details-dietary-preference.md) | Optional | The dietary preferences for the `FOOD_AND_BEV` item. | +| `ingredients` | [`CatalogItemFoodAndBeverageDetailsIngredient[] \| null \| undefined`](../../doc/models/catalog-item-food-and-beverage-details-ingredient.md) | Optional | The ingredients for the `FOOD_AND_BEV` type item. | + +## Example (as JSON) + +```json +{ + "calorie_count": 36, + "dietary_preferences": [ + { + "type": "STANDARD", + "standard_name": "VEGETARIAN", + "custom_name": "custom_name8" + } + ], + "ingredients": [ + { + "type": "STANDARD", + "standard_name": "MILK", + "custom_name": "custom_name8" + }, + { + "type": "STANDARD", + "standard_name": "MILK", + "custom_name": "custom_name8" + } + ] +} +``` + diff --git a/legacy/doc/models/catalog-item-modifier-list-info.md b/legacy/doc/models/catalog-item-modifier-list-info.md new file mode 100644 index 000000000..462a24bb0 --- /dev/null +++ b/legacy/doc/models/catalog-item-modifier-list-info.md @@ -0,0 +1,43 @@ + +# Catalog Item Modifier List Info + +References a text-based modifier or a list of non text-based modifiers applied to a `CatalogItem` instance +and specifies supported behaviors of the application. + +## Structure + +`CatalogItemModifierListInfo` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `modifierListId` | `string` | Required | The ID of the `CatalogModifierList` controlled by this `CatalogModifierListInfo`.
**Constraints**: *Minimum Length*: `1` | +| `modifierOverrides` | [`CatalogModifierOverride[] \| null \| undefined`](../../doc/models/catalog-modifier-override.md) | Optional | A set of `CatalogModifierOverride` objects that override whether a given `CatalogModifier` is enabled by default. | +| `minSelectedModifiers` | `number \| null \| undefined` | Optional | If 0 or larger, the smallest number of `CatalogModifier`s that must be selected from this `CatalogModifierList`.
The default value is `-1`.

When `CatalogModifierList.selection_type` is `MULTIPLE`, `CatalogModifierListInfo.min_selected_modifiers=-1`
and `CatalogModifierListInfo.max_selected_modifier=-1` means that from zero to the maximum number of modifiers of
the `CatalogModifierList` can be selected from the `CatalogModifierList`.

When the `CatalogModifierList.selection_type` is `SINGLE`, `CatalogModifierListInfo.min_selected_modifiers=-1`
and `CatalogModifierListInfo.max_selected_modifier=-1` means that exactly one modifier must be present in
and can be selected from the `CatalogModifierList` | +| `maxSelectedModifiers` | `number \| null \| undefined` | Optional | If 0 or larger, the largest number of `CatalogModifier`s that can be selected from this `CatalogModifierList`.
The default value is `-1`.

When `CatalogModifierList.selection_type` is `MULTIPLE`, `CatalogModifierListInfo.min_selected_modifiers=-1`
and `CatalogModifierListInfo.max_selected_modifier=-1` means that from zero to the maximum number of modifiers of
the `CatalogModifierList` can be selected from the `CatalogModifierList`.

When the `CatalogModifierList.selection_type` is `SINGLE`, `CatalogModifierListInfo.min_selected_modifiers=-1`
and `CatalogModifierListInfo.max_selected_modifier=-1` means that exactly one modifier must be present in
and can be selected from the `CatalogModifierList` | +| `enabled` | `boolean \| null \| undefined` | Optional | If `true`, enable this `CatalogModifierList`. The default value is `true`. | +| `ordinal` | `number \| null \| undefined` | Optional | The position of this `CatalogItemModifierListInfo` object within the `modifier_list_info` list applied
to a `CatalogItem` instance. | + +## Example (as JSON) + +```json +{ + "modifier_list_id": "modifier_list_id6", + "modifier_overrides": [ + { + "modifier_id": "modifier_id8", + "on_by_default": false + }, + { + "modifier_id": "modifier_id8", + "on_by_default": false + } + ], + "min_selected_modifiers": 170, + "max_selected_modifiers": 66, + "enabled": false, + "ordinal": 204 +} +``` + diff --git a/legacy/doc/models/catalog-item-option-for-item.md b/legacy/doc/models/catalog-item-option-for-item.md new file mode 100644 index 000000000..a811f3dea --- /dev/null +++ b/legacy/doc/models/catalog-item-option-for-item.md @@ -0,0 +1,24 @@ + +# Catalog Item Option for Item + +An option that can be assigned to an item. +For example, a t-shirt item may offer a color option or a size option. + +## Structure + +`CatalogItemOptionForItem` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `itemOptionId` | `string \| null \| undefined` | Optional | The unique id of the item option, used to form the dimensions of the item option matrix in a specified order. | + +## Example (as JSON) + +```json +{ + "item_option_id": "item_option_id4" +} +``` + diff --git a/legacy/doc/models/catalog-item-option-value-for-item-variation.md b/legacy/doc/models/catalog-item-option-value-for-item-variation.md new file mode 100644 index 000000000..2fcd59641 --- /dev/null +++ b/legacy/doc/models/catalog-item-option-value-for-item-variation.md @@ -0,0 +1,28 @@ + +# Catalog Item Option Value for Item Variation + +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". + +## Structure + +`CatalogItemOptionValueForItemVariation` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `itemOptionId` | `string \| null \| undefined` | Optional | The unique id of an item option. | +| `itemOptionValueId` | `string \| null \| undefined` | Optional | The unique id of the selected value for the item option. | + +## Example (as JSON) + +```json +{ + "item_option_id": "item_option_id0", + "item_option_value_id": "item_option_value_id2" +} +``` + diff --git a/legacy/doc/models/catalog-item-option-value.md b/legacy/doc/models/catalog-item-option-value.md new file mode 100644 index 000000000..be7e281aa --- /dev/null +++ b/legacy/doc/models/catalog-item-option-value.md @@ -0,0 +1,33 @@ + +# Catalog Item Option Value + +An enumerated value that can link a +`CatalogItemVariation` to an item option as one of +its item option values. + +## Structure + +`CatalogItemOptionValue` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `itemOptionId` | `string \| null \| undefined` | Optional | Unique ID of the associated item option. | +| `name` | `string \| null \| undefined` | Optional | Name of this item option value. This is a searchable attribute for use in applicable query filters. | +| `description` | `string \| null \| undefined` | Optional | A human-readable description for the option value. This is a searchable attribute for use in applicable query filters. | +| `color` | `string \| null \| undefined` | Optional | 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` | `number \| null \| undefined` | Optional | Determines where this option value appears in a list of option values. | + +## Example (as JSON) + +```json +{ + "item_option_id": "item_option_id6", + "name": "name4", + "description": "description4", + "color": "color8", + "ordinal": 198 +} +``` + diff --git a/legacy/doc/models/catalog-item-option.md b/legacy/doc/models/catalog-item-option.md new file mode 100644 index 000000000..ae0300ccd --- /dev/null +++ b/legacy/doc/models/catalog-item-option.md @@ -0,0 +1,104 @@ + +# Catalog Item Option + +A group of variations for a `CatalogItem`. + +## Structure + +`CatalogItemOption` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `string \| null \| undefined` | Optional | 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. | +| `displayName` | `string \| null \| undefined` | Optional | The item option's display name for the customer. This is a searchable attribute for use in applicable query filters. | +| `description` | `string \| null \| undefined` | Optional | 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. | +| `showColors` | `boolean \| null \| undefined` | Optional | If true, display colors for entries in `values` when present. | +| `values` | [`CatalogObject[] \| null \| undefined`](../../doc/models/catalog-object.md) | Optional | A list of CatalogObjects containing the
`CatalogItemOptionValue`s for this item. | + +## Example (as JSON) + +```json +{ + "name": "name2", + "display_name": "display_name2", + "description": "description2", + "show_colors": false, + "values": [ + { + "type": "IMAGE", + "id": "id0", + "updated_at": "updated_at6", + "version": 116, + "is_deleted": false, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key2": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] + }, + { + "type": "IMAGE", + "id": "id0", + "updated_at": "updated_at6", + "version": 116, + "is_deleted": false, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key2": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] + } + ] +} +``` + diff --git a/legacy/doc/models/catalog-item-product-type.md b/legacy/doc/models/catalog-item-product-type.md new file mode 100644 index 000000000..e08694ef8 --- /dev/null +++ b/legacy/doc/models/catalog-item-product-type.md @@ -0,0 +1,23 @@ + +# Catalog Item Product Type + +The type of a CatalogItem. Connect V2 only allows the creation of `REGULAR` or `APPOINTMENTS_SERVICE` items. + +## Enumeration + +`CatalogItemProductType` + +## Fields + +| Name | Description | +| --- | --- | +| `REGULAR` | An ordinary item. | +| `GIFT_CARD` | A Square gift card. | +| `APPOINTMENTS_SERVICE` | A service that can be booked using the Square Appointments app. | +| `FOOD_AND_BEV` | A food or beverage item that can be sold by restaurants and other food venues. | +| `EVENT` | An event which tickets can be sold for, including location, address, and times. | +| `DIGITAL` | A digital item like an ebook or song. | +| `DONATION` | A donation which site visitors can send for any cause. | +| `LEGACY_SQUARE_ONLINE_SERVICE` | 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. | +| `LEGACY_SQUARE_ONLINE_MEMBERSHIP` | 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. | + diff --git a/legacy/doc/models/catalog-item-variation.md b/legacy/doc/models/catalog-item-variation.md new file mode 100644 index 000000000..5fec7e1da --- /dev/null +++ b/legacy/doc/models/catalog-item-variation.md @@ -0,0 +1,56 @@ + +# Catalog Item Variation + +An item variation, representing a product for sale, in the Catalog object model. Each [item](../../doc/models/catalog-item.md) 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. + +## Structure + +`CatalogItemVariation` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `itemId` | `string \| null \| undefined` | Optional | The ID of the `CatalogItem` associated with this item variation. | +| `name` | `string \| null \| undefined` | Optional | 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` | `string \| null \| undefined` | Optional | The item variation's SKU, if any. This is a searchable attribute for use in applicable query filters. | +| `upc` | `string \| null \| undefined` | Optional | 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` | `number \| undefined` | Optional | 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. | +| `pricingType` | [`string \| undefined`](../../doc/models/catalog-pricing-type.md) | Optional | Indicates whether the price of a CatalogItemVariation should be entered manually at the time of sale. | +| `priceMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `locationOverrides` | [`ItemVariationLocationOverrides[] \| null \| undefined`](../../doc/models/item-variation-location-overrides.md) | Optional | Per-location price and inventory overrides. | +| `trackInventory` | `boolean \| null \| undefined` | Optional | If `true`, inventory tracking is active for the variation. | +| `inventoryAlertType` | [`string \| undefined`](../../doc/models/inventory-alert-type.md) | Optional | Indicates whether Square should alert the merchant when the inventory quantity of a CatalogItemVariation is low. | +| `inventoryAlertThreshold` | `bigint \| null \| undefined` | Optional | 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. | +| `userData` | `string \| null \| undefined` | Optional | Arbitrary user metadata to associate with the item variation. This attribute value length is of Unicode code points.
**Constraints**: *Maximum Length*: `255` | +| `serviceDuration` | `bigint \| null \| undefined` | Optional | 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). | +| `availableForBooking` | `boolean \| null \| undefined` | Optional | If the `CatalogItem` that owns this item variation is of type
`APPOINTMENTS_SERVICE`, a bool representing whether this service is available for booking. | +| `itemOptionValues` | [`CatalogItemOptionValueForItemVariation[] \| null \| undefined`](../../doc/models/catalog-item-option-value-for-item-variation.md) | Optional | List of item option values associated with this item variation. Listed
in the same order as the item options of the parent item. | +| `measurementUnitId` | `string \| null \| undefined` | Optional | 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` | `boolean \| null \| undefined` | Optional | 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` | `boolean \| null \| undefined` | Optional | 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. | +| `imageIds` | `string[] \| null \| undefined` | Optional | The IDs of images associated with this `CatalogItemVariation` instance.
These images will be shown to customers in Square Online Store. | +| `teamMemberIds` | `string[] \| null \| undefined` | Optional | Tokens of employees that can perform the service represented by this variation. Only valid for
variations of type `APPOINTMENTS_SERVICE`. | +| `stockableConversion` | [`CatalogStockConversion \| undefined`](../../doc/models/catalog-stock-conversion.md) | Optional | Represents the rule of conversion between a stockable [CatalogItemVariation](../../doc/models/catalog-item-variation.md)
and a non-stockable sell-by or receive-by `CatalogItemVariation` that
share the same underlying stock. | + +## Example (as JSON) + +```json +{ + "item_id": "item_id4", + "name": "name4", + "sku": "sku0", + "upc": "upc2", + "ordinal": 76 +} +``` + diff --git a/legacy/doc/models/catalog-item.md b/legacy/doc/models/catalog-item.md new file mode 100644 index 000000000..5b538f3c5 --- /dev/null +++ b/legacy/doc/models/catalog-item.md @@ -0,0 +1,51 @@ + +# Catalog Item + +A [CatalogObject](../../doc/models/catalog-object.md) instance of the `ITEM` type, also referred to as an item, in the catalog. + +## Structure + +`CatalogItem` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `512` | +| `description` | `string \| null \| undefined` | Optional | 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`.
**Constraints**: *Maximum Length*: `4096` | +| `abbreviation` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `24` | +| `labelColor` | `string \| null \| undefined` | Optional | The color of the item's display label in the Square Point of Sale app. This must be a valid hex color code. | +| `isTaxable` | `boolean \| null \| undefined` | Optional | Indicates whether the item is taxable (`true`) or non-taxable (`false`). Default is `true`. | +| `availableOnline` | `boolean \| null \| undefined` | Optional | If `true`, the item can be added to shipping orders from the merchant's online store. | +| `availableForPickup` | `boolean \| null \| undefined` | Optional | If `true`, the item can be added to pickup orders from the merchant's online store. | +| `availableElectronically` | `boolean \| null \| undefined` | Optional | If `true`, the item can be added to electronically fulfilled orders from the merchant's online store. | +| `categoryId` | `string \| null \| undefined` | Optional | The ID of the item's category, if any. Deprecated since 2023-12-13. Use `CatalogItem.categories`, instead. | +| `taxIds` | `string[] \| null \| undefined` | Optional | 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`. | +| `modifierListInfo` | [`CatalogItemModifierListInfo[] \| null \| undefined`](../../doc/models/catalog-item-modifier-list-info.md) | Optional | 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` | [`CatalogObject[] \| null \| undefined`](../../doc/models/catalog-object.md) | Optional | A list of [CatalogItemVariation](entity:CatalogItemVariation) objects for this item. An item must have
at least one variation. | +| `productType` | [`string \| undefined`](../../doc/models/catalog-item-product-type.md) | Optional | The type of a CatalogItem. Connect V2 only allows the creation of `REGULAR` or `APPOINTMENTS_SERVICE` items. | +| `skipModifierScreen` | `boolean \| null \| undefined` | Optional | 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. | +| `itemOptions` | [`CatalogItemOptionForItem[] \| null \| undefined`](../../doc/models/catalog-item-option-for-item.md) | Optional | List of item options IDs for this item. Used to manage and group item
variations in a specified order.

Maximum: 6 item options. | +| `imageIds` | `string[] \| null \| undefined` | Optional | 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. | +| `sortName` | `string \| null \| undefined` | Optional | 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` | [`CatalogObjectCategory[] \| null \| undefined`](../../doc/models/catalog-object-category.md) | Optional | The list of categories. | +| `descriptionHtml` | `string \| null \| undefined` | Optional | 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
**Constraints**: *Maximum Length*: `65535` | +| `descriptionPlaintext` | `string \| undefined` | Optional | A server-generated plaintext version of the `description_html` field, without formatting tags.
**Constraints**: *Maximum Length*: `65535` | +| `channels` | `string[] \| null \| undefined` | Optional | A list of IDs representing channels, such as a Square Online site, where the item can be made visible or available. | +| `isArchived` | `boolean \| null \| undefined` | Optional | Indicates whether this item is archived (`true`) or not (`false`). | +| `ecomSeoData` | [`CatalogEcomSeoData \| undefined`](../../doc/models/catalog-ecom-seo-data.md) | Optional | SEO data for for a seller's Square Online store. | +| `foodAndBeverageDetails` | [`CatalogItemFoodAndBeverageDetails \| undefined`](../../doc/models/catalog-item-food-and-beverage-details.md) | Optional | The food and beverage-specific details of a `FOOD_AND_BEV` item. | +| `reportingCategory` | [`CatalogObjectCategory \| undefined`](../../doc/models/catalog-object-category.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "name": "name6", + "description": "description6", + "abbreviation": "abbreviation8", + "label_color": "label_color8", + "is_taxable": false +} +``` + diff --git a/legacy/doc/models/catalog-measurement-unit.md b/legacy/doc/models/catalog-measurement-unit.md new file mode 100644 index 000000000..31ab1b14b --- /dev/null +++ b/legacy/doc/models/catalog-measurement-unit.md @@ -0,0 +1,35 @@ + +# Catalog Measurement Unit + +Represents the unit used to measure a `CatalogItemVariation` and +specifies the precision for decimal quantities. + +## Structure + +`CatalogMeasurementUnit` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `measurementUnit` | [`MeasurementUnit \| undefined`](../../doc/models/measurement-unit.md) | Optional | 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`. | +| `precision` | `number \| null \| undefined` | Optional | 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 | + +## Example (as JSON) + +```json +{ + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 78 +} +``` + diff --git a/legacy/doc/models/catalog-modifier-list-modifier-type.md b/legacy/doc/models/catalog-modifier-list-modifier-type.md new file mode 100644 index 000000000..eede3572e --- /dev/null +++ b/legacy/doc/models/catalog-modifier-list-modifier-type.md @@ -0,0 +1,16 @@ + +# Catalog Modifier List Modifier Type + +Defines the type of `CatalogModifierList`. + +## Enumeration + +`CatalogModifierListModifierType` + +## Fields + +| Name | Description | +| --- | --- | +| `LIST` | The `CatalogModifierList` instance is a non-empty list of non text-based modifiers. | +| `TEXT` | The `CatalogModifierList` instance is a single text-based modifier. | + diff --git a/legacy/doc/models/catalog-modifier-list-selection-type.md b/legacy/doc/models/catalog-modifier-list-selection-type.md new file mode 100644 index 000000000..3a4281813 --- /dev/null +++ b/legacy/doc/models/catalog-modifier-list-selection-type.md @@ -0,0 +1,16 @@ + +# Catalog Modifier List Selection Type + +Indicates whether a CatalogModifierList supports multiple selections. + +## Enumeration + +`CatalogModifierListSelectionType` + +## Fields + +| Name | Description | +| --- | --- | +| `SINGLE` | Indicates that a CatalogModifierList allows only a
single CatalogModifier to be selected. | +| `MULTIPLE` | Indicates that a CatalogModifierList allows multiple
CatalogModifier to be selected. | + diff --git a/legacy/doc/models/catalog-modifier-list.md b/legacy/doc/models/catalog-modifier-list.md new file mode 100644 index 000000000..aff0496cf --- /dev/null +++ b/legacy/doc/models/catalog-modifier-list.md @@ -0,0 +1,93 @@ + +# Catalog Modifier List + +For a text-based modifier, this encapsulates the modifier's text when its `modifier_type` is `TEXT`. +For example, to sell T-shirts with custom prints, a text-based modifier can be used to capture the buyer-supplied +text string to be selected for the T-shirt at the time of sale. + +For non text-based modifiers, this encapsulates a non-empty list of modifiers applicable to items +at the time of sale. Each element of the modifier list is a `CatalogObject` instance of the `MODIFIER` type. +For example, a "Condiments" modifier list applicable to a "Hot Dog" item +may contain "Ketchup", "Mustard", and "Relish" modifiers. + +A non text-based modifier can be applied to the modified item once or multiple times, if the `selection_type` field +is set to `SINGLE` or `MULTIPLE`, respectively. On the other hand, a text-based modifier can be applied to the item +only once and the `selection_type` field is always set to `SINGLE`. + +## Structure + +`CatalogModifierList` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `255` | +| `ordinal` | `number \| null \| undefined` | Optional | The position of this `CatalogModifierList` within a list of `CatalogModifierList` instances. | +| `selectionType` | [`string \| undefined`](../../doc/models/catalog-modifier-list-selection-type.md) | Optional | Indicates whether a CatalogModifierList supports multiple selections. | +| `modifiers` | [`CatalogObject[] \| null \| undefined`](../../doc/models/catalog-object.md) | Optional | 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>}}
}
``` | +| `imageIds` | `string[] \| null \| undefined` | Optional | 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. | +| `modifierType` | [`string \| undefined`](../../doc/models/catalog-modifier-list-modifier-type.md) | Optional | Defines the type of `CatalogModifierList`. | +| `maxLength` | `number \| null \| undefined` | Optional | 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`. | +| `textRequired` | `boolean \| null \| undefined` | Optional | 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`. | +| `internalName` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `512` | + +## Example (as JSON) + +```json +{ + "name": "name4", + "ordinal": 226, + "selection_type": "SINGLE", + "modifiers": [ + { + "type": "TAX", + "id": "id4", + "updated_at": "updated_at0", + "version": 210, + "is_deleted": false, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key2": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] + } + ], + "image_ids": [ + "image_ids9" + ] +} +``` + diff --git a/legacy/doc/models/catalog-modifier-override.md b/legacy/doc/models/catalog-modifier-override.md new file mode 100644 index 000000000..d996fa7b6 --- /dev/null +++ b/legacy/doc/models/catalog-modifier-override.md @@ -0,0 +1,25 @@ + +# Catalog Modifier Override + +Options to control how to override the default behavior of the specified modifier. + +## Structure + +`CatalogModifierOverride` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `modifierId` | `string` | Required | The ID of the `CatalogModifier` whose default behavior is being overridden.
**Constraints**: *Minimum Length*: `1` | +| `onByDefault` | `boolean \| null \| undefined` | Optional | If `true`, this `CatalogModifier` should be selected by default for this `CatalogItem`. | + +## Example (as JSON) + +```json +{ + "modifier_id": "modifier_id2", + "on_by_default": false +} +``` + diff --git a/legacy/doc/models/catalog-modifier.md b/legacy/doc/models/catalog-modifier.md new file mode 100644 index 000000000..703adca29 --- /dev/null +++ b/legacy/doc/models/catalog-modifier.md @@ -0,0 +1,71 @@ + +# Catalog Modifier + +A modifier applicable to items at the time of sale. An example of a modifier is a Cheese add-on to a Burger item. + +## Structure + +`CatalogModifier` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `string \| null \| undefined` | Optional | The modifier name. This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points.
**Constraints**: *Maximum Length*: `255` | +| `priceMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `ordinal` | `number \| null \| undefined` | Optional | Determines where this `CatalogModifier` appears in the `CatalogModifierList`. | +| `modifierListId` | `string \| null \| undefined` | Optional | The ID of the `CatalogModifierList` associated with this modifier. | +| `locationOverrides` | [`ModifierLocationOverrides[] \| null \| undefined`](../../doc/models/modifier-location-overrides.md) | Optional | Location-specific price overrides. | +| `imageId` | `string \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "object": { + "modifier_data": { + "name": "Almond Milk", + "price_money": { + "amount": 250, + "currency": "USD" + } + }, + "present_at_all_locations": true, + "type": "MODIFIER" + }, + "name": "name6", + "price_money": { + "amount": 202, + "currency": "GTQ" + }, + "ordinal": 70, + "modifier_list_id": "modifier_list_id2", + "location_overrides": [ + { + "location_id": "location_id8", + "price_money": { + "amount": 202, + "currency": "GTQ" + }, + "sold_out": false + }, + { + "location_id": "location_id8", + "price_money": { + "amount": 202, + "currency": "GTQ" + }, + "sold_out": false + }, + { + "location_id": "location_id8", + "price_money": { + "amount": 202, + "currency": "GTQ" + }, + "sold_out": false + } + ] +} +``` + diff --git a/legacy/doc/models/catalog-object-batch.md b/legacy/doc/models/catalog-object-batch.md new file mode 100644 index 000000000..a474aabd6 --- /dev/null +++ b/legacy/doc/models/catalog-object-batch.md @@ -0,0 +1,113 @@ + +# Catalog Object Batch + +A batch of catalog objects. + +## Structure + +`CatalogObjectBatch` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `objects` | [`CatalogObject[]`](../../doc/models/catalog-object.md) | Required | A list of CatalogObjects belonging to this batch. | + +## Example (as JSON) + +```json +{ + "objects": [ + { + "type": "PRODUCT_SET", + "id": "id6", + "category_data": { + "object": { + "category_data": { + "name": "Beverages" + }, + "id": "#Beverages", + "present_at_all_locations": true, + "type": "CATEGORY" + } + }, + "tax_data": { + "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" + } + }, + "discount_data": { + "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" + } + }, + "modifier_data": { + "object": { + "modifier_data": { + "name": "Almond Milk", + "price_money": { + "amount": 250, + "currency": "USD" + } + }, + "present_at_all_locations": true, + "type": "MODIFIER" + } + }, + "updated_at": "updated_at2", + "version": 164, + "is_deleted": false, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] + } + ] +} +``` + diff --git a/legacy/doc/models/catalog-object-category.md b/legacy/doc/models/catalog-object-category.md new file mode 100644 index 000000000..2d338d868 --- /dev/null +++ b/legacy/doc/models/catalog-object-category.md @@ -0,0 +1,27 @@ + +# Catalog Object Category + +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. + +## Structure + +`CatalogObjectCategory` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | The ID of the object's category. | +| `ordinal` | `bigint \| null \| undefined` | Optional | The order of the object within the context of the category. | + +## Example (as JSON) + +```json +{ + "id": "id4", + "ordinal": 8 +} +``` + diff --git a/legacy/doc/models/catalog-object-reference.md b/legacy/doc/models/catalog-object-reference.md new file mode 100644 index 000000000..80619d870 --- /dev/null +++ b/legacy/doc/models/catalog-object-reference.md @@ -0,0 +1,27 @@ + +# Catalog Object Reference + +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. + +## Structure + +`CatalogObjectReference` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `objectId` | `string \| null \| undefined` | Optional | The ID of the referenced object. | +| `catalogVersion` | `bigint \| null \| undefined` | Optional | The version of the object. | + +## Example (as JSON) + +```json +{ + "object_id": "object_id0", + "catalog_version": 84 +} +``` + diff --git a/legacy/doc/models/catalog-object-type.md b/legacy/doc/models/catalog-object-type.md new file mode 100644 index 000000000..ada605a92 --- /dev/null +++ b/legacy/doc/models/catalog-object-type.md @@ -0,0 +1,34 @@ + +# Catalog Object Type + +Possible types of CatalogObjects returned from the catalog, each +containing type-specific properties in the `*_data` field corresponding to the specified object type. + +## Enumeration + +`CatalogObjectType` + +## Fields + +| Name | Description | +| --- | --- | +| `ITEM` | The `CatalogObject` instance is of the [CatalogItem](../../doc/models/catalog-item.md) type and represents an item. The item-specific data
must be set on the `item_data` field. | +| `IMAGE` | The `CatalogObject` instance is of the [CatalogImage](../../doc/models/catalog-image.md) type and represents an image. The image-specific data
must be set on the `image_data` field. | +| `CATEGORY` | The `CatalogObject` instance is of the [CatalogCategory](../../doc/models/catalog-category.md) type and represents a category. The category-specific data
must be set on the `category_data` field. | +| `ITEM_VARIATION` | The `CatalogObject` instance is of the [CatalogItemVariation](../../doc/models/catalog-item-variation.md) type and represents an item variation, also referred to as variation.
The item variation-specific data must be set on the `item_variation_data` field. | +| `TAX` | The `CatalogObject` instance is of the [CatalogTax](../../doc/models/catalog-tax.md) type and represents a tax. The tax-specific data
must be set on the `tax_data` field. | +| `DISCOUNT` | The `CatalogObject` instance is of the [CatalogDiscount](../../doc/models/catalog-discount.md) type and represents a discount. The discount-specific data
must be set on the `discount_data` field. | +| `MODIFIER_LIST` | The `CatalogObject` instance is of the [CatalogModifierList](../../doc/models/catalog-modifier-list.md) type and represents a modifier list.
The modifier-list-specific data must be set on the `modifier_list_data` field. | +| `MODIFIER` | The `CatalogObject` instance is of the [CatalogModifier](../../doc/models/catalog-modifier.md) type and represents a modifier. The modifier-specific data
must be set on the `modifier_data` field. | +| `PRICING_RULE` | The `CatalogObject` instance is of the [CatalogPricingRule](../../doc/models/catalog-pricing-rule.md) type and represents a pricing rule. The pricing-rule-specific data
must be set on the `pricing_rule_data` field. | +| `PRODUCT_SET` | The `CatalogObject` instance is of the [CatalogProductSet](../../doc/models/catalog-product-set.md) type and represents a product set.
The product-set-specific data will be stored in the `product_set_data` field. | +| `TIME_PERIOD` | The `CatalogObject` instance is of the [CatalogTimePeriod](../../doc/models/catalog-time-period.md) type and represents a time period.
The time-period-specific data must be set on the `time_period_data` field. | +| `MEASUREMENT_UNIT` | The `CatalogObject` instance is of the [CatalogMeasurementUnit](../../doc/models/catalog-measurement-unit.md) type and represents a measurement unit specifying the unit of
measure and precision in which an item variation is sold. The measurement-unit-specific data must set on the `measurement_unit_data` field. | +| `SUBSCRIPTION_PLAN_VARIATION` | The `CatalogObject` instance is of the [CatalogSubscriptionPlan](../../doc/models/catalog-subscription-plan.md) type and represents a subscription plan.
The subscription-plan-specific data must be stored on the `subscription_plan_data` field. | +| `ITEM_OPTION` | The `CatalogObject` instance is of the [CatalogItemOption](../../doc/models/catalog-item-option.md) type and represents a list of options (such as a color or size of a T-shirt)
that can be assigned to item variations. The item-option-specific data must be on the `item_option_data` field. | +| `ITEM_OPTION_VAL` | The `CatalogObject` instance is of the [CatalogItemOptionValue](../../doc/models/catalog-item-option-value.md) type and represents a value associated with one or more item options.
For example, an item option of "Size" may have item option values such as "Small" or "Medium".
The item-option-value-specific data must be on the `item_option_value_data` field. | +| `CUSTOM_ATTRIBUTE_DEFINITION` | The `CatalogObject` instance is of the [CatalogCustomAttributeDefinition](../../doc/models/catalog-custom-attribute-definition.md) type and represents the definition of a custom attribute.
The custom-attribute-definition-specific data must be set on the `custom_attribute_definition_data` field. | +| `QUICK_AMOUNTS_SETTINGS` | The `CatalogObject` instance is of the [CatalogQuickAmountsSettings](../../doc/models/catalog-quick-amounts-settings.md) type and represents settings to configure preset charges for quick payments at each location.
For example, a location may have a list of both AUTO and MANUAL quick amounts that are set to DISABLED.
The quick-amounts-settings-specific data must be set on the `quick_amounts_settings_data` field. | +| `SUBSCRIPTION_PLAN` | The `CatalogObject` instance is of the [CatalogSubscriptionPlan](../../doc/models/catalog-subscription-plan.md) type and represents a subscription plan.
The subscription plan specific data must be stored on the `subscription_plan_data` field. | +| `AVAILABILITY_PERIOD` | The `CatalogObject` instance is of the [CatalogAvailabilityPeriod](../../doc/models/catalog-availability-period.md) type and represents an availability period.
The availability period specific data must be stored on the `availability_period_data` field. | + diff --git a/legacy/doc/models/catalog-object.md b/legacy/doc/models/catalog-object.md new file mode 100644 index 000000000..d3f541cea --- /dev/null +++ b/legacy/doc/models/catalog-object.md @@ -0,0 +1,153 @@ + +# Catalog Object + +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. + +## Structure + +`CatalogObject` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `type` | [`string`](../../doc/models/catalog-object-type.md) | Required | Possible types of CatalogObjects returned from the catalog, each
containing type-specific properties in the `*_data` field corresponding to the specified object type. | +| `id` | `string` | Required | 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.
**Constraints**: *Minimum Length*: `1` | +| `updatedAt` | `string \| undefined` | Optional | 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` | `bigint \| undefined` | Optional | 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. | +| `isDeleted` | `boolean \| null \| undefined` | Optional | 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. | +| `customAttributeValues` | [`Record \| null \| undefined`](../../doc/models/catalog-custom-attribute-value.md) | Optional | 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.). | +| `catalogV1Ids` | [`CatalogV1Id[] \| null \| undefined`](../../doc/models/catalog-v1-id.md) | Optional | 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. | +| `presentAtAllLocations` | `boolean \| null \| undefined` | Optional | 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`. | +| `presentAtLocationIds` | `string[] \| null \| undefined` | Optional | A list of locations where the object is present, even if `present_at_all_locations` is `false`.
This can include locations that are deactivated. | +| `absentAtLocationIds` | `string[] \| null \| undefined` | Optional | 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. | +| `itemData` | [`CatalogItem \| undefined`](../../doc/models/catalog-item.md) | Optional | A [CatalogObject](../../doc/models/catalog-object.md) instance of the `ITEM` type, also referred to as an item, in the catalog. | +| `categoryData` | [`CatalogCategory \| undefined`](../../doc/models/catalog-category.md) | Optional | A category to which a `CatalogItem` instance belongs. | +| `itemVariationData` | [`CatalogItemVariation \| undefined`](../../doc/models/catalog-item-variation.md) | Optional | An item variation, representing a product for sale, in the Catalog object model. Each [item](../../doc/models/catalog-item.md) 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. | +| `taxData` | [`CatalogTax \| undefined`](../../doc/models/catalog-tax.md) | Optional | A tax applicable to an item. | +| `discountData` | [`CatalogDiscount \| undefined`](../../doc/models/catalog-discount.md) | Optional | A discount applicable to items. | +| `modifierListData` | [`CatalogModifierList \| undefined`](../../doc/models/catalog-modifier-list.md) | Optional | For a text-based modifier, this encapsulates the modifier's text when its `modifier_type` is `TEXT`.
For example, to sell T-shirts with custom prints, a text-based modifier can be used to capture the buyer-supplied
text string to be selected for the T-shirt at the time of sale.

For non text-based modifiers, this encapsulates a non-empty list of modifiers applicable to items
at the time of sale. Each element of the modifier list is a `CatalogObject` instance of the `MODIFIER` type.
For example, a "Condiments" modifier list applicable to a "Hot Dog" item
may contain "Ketchup", "Mustard", and "Relish" modifiers.

A non text-based modifier can be applied to the modified item once or multiple times, if the `selection_type` field
is set to `SINGLE` or `MULTIPLE`, respectively. On the other hand, a text-based modifier can be applied to the item
only once and the `selection_type` field is always set to `SINGLE`. | +| `modifierData` | [`CatalogModifier \| undefined`](../../doc/models/catalog-modifier.md) | Optional | A modifier applicable to items at the time of sale. An example of a modifier is a Cheese add-on to a Burger item. | +| `timePeriodData` | [`CatalogTimePeriod \| undefined`](../../doc/models/catalog-time-period.md) | Optional | Represents a time period - either a single period or a repeating period. | +| `productSetData` | [`CatalogProductSet \| undefined`](../../doc/models/catalog-product-set.md) | Optional | 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. | +| `pricingRuleData` | [`CatalogPricingRule \| undefined`](../../doc/models/catalog-pricing-rule.md) | Optional | Defines how discounts are automatically applied to a set of items that match the pricing rule
during the active time period. | +| `imageData` | [`CatalogImage \| undefined`](../../doc/models/catalog-image.md) | Optional | 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. | +| `measurementUnitData` | [`CatalogMeasurementUnit \| undefined`](../../doc/models/catalog-measurement-unit.md) | Optional | Represents the unit used to measure a `CatalogItemVariation` and
specifies the precision for decimal quantities. | +| `subscriptionPlanData` | [`CatalogSubscriptionPlan \| undefined`](../../doc/models/catalog-subscription-plan.md) | Optional | 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). | +| `itemOptionData` | [`CatalogItemOption \| undefined`](../../doc/models/catalog-item-option.md) | Optional | A group of variations for a `CatalogItem`. | +| `itemOptionValueData` | [`CatalogItemOptionValue \| undefined`](../../doc/models/catalog-item-option-value.md) | Optional | An enumerated value that can link a
`CatalogItemVariation` to an item option as one of
its item option values. | +| `customAttributeDefinitionData` | [`CatalogCustomAttributeDefinition \| undefined`](../../doc/models/catalog-custom-attribute-definition.md) | Optional | 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) | +| `quickAmountsSettingsData` | [`CatalogQuickAmountsSettings \| undefined`](../../doc/models/catalog-quick-amounts-settings.md) | Optional | A parent Catalog Object model represents a set of Quick Amounts and the settings control the amounts. | +| `subscriptionPlanVariationData` | [`CatalogSubscriptionPlanVariation \| undefined`](../../doc/models/catalog-subscription-plan-variation.md) | Optional | 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). | +| `availabilityPeriodData` | [`CatalogAvailabilityPeriod \| undefined`](../../doc/models/catalog-availability-period.md) | Optional | Represents a time period of availability. | + +## Example (as JSON) + +```json +{ + "type": "TIME_PERIOD", + "id": "id4", + "category_data": { + "object": { + "category_data": { + "name": "Beverages" + }, + "id": "#Beverages", + "present_at_all_locations": true, + "type": "CATEGORY" + } + }, + "tax_data": { + "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" + } + }, + "discount_data": { + "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" + } + }, + "modifier_data": { + "object": { + "modifier_data": { + "name": "Almond Milk", + "price_money": { + "amount": 250, + "currency": "USD" + } + }, + "present_at_all_locations": true, + "type": "MODIFIER" + } + }, + "updated_at": "updated_at0", + "version": 186, + "is_deleted": false, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key2": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] +} +``` + diff --git a/legacy/doc/models/catalog-pricing-rule.md b/legacy/doc/models/catalog-pricing-rule.md new file mode 100644 index 000000000..aebca6c9f --- /dev/null +++ b/legacy/doc/models/catalog-pricing-rule.md @@ -0,0 +1,42 @@ + +# Catalog Pricing Rule + +Defines how discounts are automatically applied to a set of items that match the pricing rule +during the active time period. + +## Structure + +`CatalogPricingRule` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `string \| null \| undefined` | Optional | User-defined name for the pricing rule. For example, "Buy one get one
free" or "10% off". | +| `timePeriodIds` | `string[] \| null \| undefined` | Optional | 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. | +| `discountId` | `string \| null \| undefined` | Optional | Unique ID for the `CatalogDiscount` to take off
the price of all matched items. | +| `matchProductsId` | `string \| null \| undefined` | Optional | 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. | +| `applyProductsId` | `string \| null \| undefined` | Optional | __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. | +| `excludeProductsId` | `string \| null \| undefined` | Optional | `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. | +| `validFromDate` | `string \| null \| undefined` | Optional | Represents the date the Pricing Rule is valid from. Represented in RFC 3339 full-date format (YYYY-MM-DD). | +| `validFromLocalTime` | `string \| null \| undefined` | Optional | 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. | +| `validUntilDate` | `string \| null \| undefined` | Optional | Represents the date the Pricing Rule is valid until. Represented in RFC 3339 full-date format (YYYY-MM-DD). | +| `validUntilLocalTime` | `string \| null \| undefined` | Optional | 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. | +| `excludeStrategy` | [`string \| undefined`](../../doc/models/exclude-strategy.md) | Optional | Indicates which products matched by a CatalogPricingRule
will be excluded if the pricing rule uses an exclude set. | +| `minimumOrderSubtotalMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `customerGroupIdsAny` | `string[] \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "name": "name6", + "time_period_ids": [ + "time_period_ids8" + ], + "discount_id": "discount_id4", + "match_products_id": "match_products_id4", + "apply_products_id": "apply_products_id0" +} +``` + diff --git a/legacy/doc/models/catalog-pricing-type.md b/legacy/doc/models/catalog-pricing-type.md new file mode 100644 index 000000000..f49d45870 --- /dev/null +++ b/legacy/doc/models/catalog-pricing-type.md @@ -0,0 +1,16 @@ + +# Catalog Pricing Type + +Indicates whether the price of a CatalogItemVariation should be entered manually at the time of sale. + +## Enumeration + +`CatalogPricingType` + +## Fields + +| Name | Description | +| --- | --- | +| `FIXED_PRICING` | The catalog item variation's price is fixed. | +| `VARIABLE_PRICING` | The catalog item variation's price is entered at the time of sale. | + diff --git a/legacy/doc/models/catalog-product-set.md b/legacy/doc/models/catalog-product-set.md new file mode 100644 index 000000000..d2e980df5 --- /dev/null +++ b/legacy/doc/models/catalog-product-set.md @@ -0,0 +1,41 @@ + +# Catalog Product Set + +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. + +## Structure + +`CatalogProductSet` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `string \| null \| undefined` | Optional | User-defined name for the product set. For example, "Clearance Items"
or "Winter Sale Items". | +| `productIdsAny` | `string[] \| null \| undefined` | Optional | 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. | +| `productIdsAll` | `string[] \| null \| undefined` | Optional | 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. | +| `quantityExact` | `bigint \| null \| undefined` | Optional | 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`. | +| `quantityMin` | `bigint \| null \| undefined` | Optional | 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. | +| `quantityMax` | `bigint \| null \| undefined` | Optional | If set, the pricing rule will apply to a maximum of this many items from
`products_any` or `products_all`. | +| `allProducts` | `boolean \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "name": "name6", + "product_ids_any": [ + "product_ids_any8" + ], + "product_ids_all": [ + "product_ids_all7" + ], + "quantity_exact": 222, + "quantity_min": 100 +} +``` + diff --git a/legacy/doc/models/catalog-query-exact.md b/legacy/doc/models/catalog-query-exact.md new file mode 100644 index 000000000..7c56d3ec6 --- /dev/null +++ b/legacy/doc/models/catalog-query-exact.md @@ -0,0 +1,25 @@ + +# Catalog Query Exact + +The query filter to return the search result by exact match of the specified attribute name and value. + +## Structure + +`CatalogQueryExact` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `attributeName` | `string` | Required | The name of the attribute to be searched. Matching of the attribute name is exact.
**Constraints**: *Minimum Length*: `1` | +| `attributeValue` | `string` | Required | 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. | + +## Example (as JSON) + +```json +{ + "attribute_name": "attribute_name4", + "attribute_value": "attribute_value6" +} +``` + diff --git a/legacy/doc/models/catalog-query-item-variations-for-item-option-values.md b/legacy/doc/models/catalog-query-item-variations-for-item-option-values.md new file mode 100644 index 000000000..c49bba1df --- /dev/null +++ b/legacy/doc/models/catalog-query-item-variations-for-item-option-values.md @@ -0,0 +1,27 @@ + +# Catalog Query Item Variations for Item Option Values + +The query filter to return the item variations containing the specified item option value IDs. + +## Structure + +`CatalogQueryItemVariationsForItemOptionValues` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `itemOptionValueIds` | `string[] \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "item_option_value_ids": [ + "item_option_value_ids0", + "item_option_value_ids9", + "item_option_value_ids8" + ] +} +``` + diff --git a/legacy/doc/models/catalog-query-items-for-item-options.md b/legacy/doc/models/catalog-query-items-for-item-options.md new file mode 100644 index 000000000..dbfc2e41b --- /dev/null +++ b/legacy/doc/models/catalog-query-items-for-item-options.md @@ -0,0 +1,26 @@ + +# Catalog Query Items for Item Options + +The query filter to return the items containing the specified item option IDs. + +## Structure + +`CatalogQueryItemsForItemOptions` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `itemOptionIds` | `string[] \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "item_option_ids": [ + "item_option_ids5", + "item_option_ids6" + ] +} +``` + diff --git a/legacy/doc/models/catalog-query-items-for-modifier-list.md b/legacy/doc/models/catalog-query-items-for-modifier-list.md new file mode 100644 index 000000000..f9d41fff6 --- /dev/null +++ b/legacy/doc/models/catalog-query-items-for-modifier-list.md @@ -0,0 +1,27 @@ + +# Catalog Query Items for Modifier List + +The query filter to return the items containing the specified modifier list IDs. + +## Structure + +`CatalogQueryItemsForModifierList` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `modifierListIds` | `string[]` | Required | A set of `CatalogModifierList` IDs to be used to find associated `CatalogItem`s. | + +## Example (as JSON) + +```json +{ + "modifier_list_ids": [ + "modifier_list_ids8", + "modifier_list_ids9", + "modifier_list_ids0" + ] +} +``` + diff --git a/legacy/doc/models/catalog-query-items-for-tax.md b/legacy/doc/models/catalog-query-items-for-tax.md new file mode 100644 index 000000000..cb4f5c129 --- /dev/null +++ b/legacy/doc/models/catalog-query-items-for-tax.md @@ -0,0 +1,26 @@ + +# Catalog Query Items for Tax + +The query filter to return the items containing the specified tax IDs. + +## Structure + +`CatalogQueryItemsForTax` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `taxIds` | `string[]` | Required | A set of `CatalogTax` IDs to be used to find associated `CatalogItem`s. | + +## Example (as JSON) + +```json +{ + "tax_ids": [ + "tax_ids9", + "tax_ids8" + ] +} +``` + diff --git a/legacy/doc/models/catalog-query-prefix.md b/legacy/doc/models/catalog-query-prefix.md new file mode 100644 index 000000000..33ee710d6 --- /dev/null +++ b/legacy/doc/models/catalog-query-prefix.md @@ -0,0 +1,25 @@ + +# Catalog Query Prefix + +The query filter to return the search result whose named attribute values are prefixed by the specified attribute value. + +## Structure + +`CatalogQueryPrefix` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `attributeName` | `string` | Required | The name of the attribute to be searched.
**Constraints**: *Minimum Length*: `1` | +| `attributePrefix` | `string` | Required | The desired prefix of the search attribute value.
**Constraints**: *Minimum Length*: `1` | + +## Example (as JSON) + +```json +{ + "attribute_name": "attribute_name8", + "attribute_prefix": "attribute_prefix6" +} +``` + diff --git a/legacy/doc/models/catalog-query-range.md b/legacy/doc/models/catalog-query-range.md new file mode 100644 index 000000000..99a93c987 --- /dev/null +++ b/legacy/doc/models/catalog-query-range.md @@ -0,0 +1,27 @@ + +# Catalog Query Range + +The query filter to return the search result whose named attribute values fall between the specified range. + +## Structure + +`CatalogQueryRange` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `attributeName` | `string` | Required | The name of the attribute to be searched.
**Constraints**: *Minimum Length*: `1` | +| `attributeMinValue` | `bigint \| null \| undefined` | Optional | The desired minimum value for the search attribute (inclusive). | +| `attributeMaxValue` | `bigint \| null \| undefined` | Optional | The desired maximum value for the search attribute (inclusive). | + +## Example (as JSON) + +```json +{ + "attribute_name": "attribute_name0", + "attribute_min_value": 184, + "attribute_max_value": 94 +} +``` + diff --git a/legacy/doc/models/catalog-query-set.md b/legacy/doc/models/catalog-query-set.md new file mode 100644 index 000000000..bedd86659 --- /dev/null +++ b/legacy/doc/models/catalog-query-set.md @@ -0,0 +1,28 @@ + +# Catalog Query Set + +The query filter to return the search result(s) by exact match of the specified `attribute_name` and any of +the `attribute_values`. + +## Structure + +`CatalogQuerySet` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `attributeName` | `string` | Required | The name of the attribute to be searched. Matching of the attribute name is exact.
**Constraints**: *Minimum Length*: `1` | +| `attributeValues` | `string[]` | Required | 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. | + +## Example (as JSON) + +```json +{ + "attribute_name": "attribute_name0", + "attribute_values": [ + "attribute_values8" + ] +} +``` + diff --git a/legacy/doc/models/catalog-query-sorted-attribute.md b/legacy/doc/models/catalog-query-sorted-attribute.md new file mode 100644 index 000000000..c1bea9b7e --- /dev/null +++ b/legacy/doc/models/catalog-query-sorted-attribute.md @@ -0,0 +1,27 @@ + +# Catalog Query Sorted Attribute + +The query expression to specify the key to sort search results. + +## Structure + +`CatalogQuerySortedAttribute` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `attributeName` | `string` | Required | The attribute whose value is used as the sort key.
**Constraints**: *Minimum Length*: `1` | +| `initialAttributeValue` | `string \| null \| undefined` | Optional | 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). | +| `sortOrder` | [`string \| undefined`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | + +## Example (as JSON) + +```json +{ + "attribute_name": "attribute_name2", + "initial_attribute_value": "initial_attribute_value4", + "sort_order": "DESC" +} +``` + diff --git a/legacy/doc/models/catalog-query-text.md b/legacy/doc/models/catalog-query-text.md new file mode 100644 index 000000000..9eeab2a0a --- /dev/null +++ b/legacy/doc/models/catalog-query-text.md @@ -0,0 +1,25 @@ + +# Catalog Query Text + +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. + +## Structure + +`CatalogQueryText` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `keywords` | `string[]` | Required | A list of 1, 2, or 3 search keywords. Keywords with fewer than 3 alphanumeric characters are ignored. | + +## Example (as JSON) + +```json +{ + "keywords": [ + "keywords1" + ] +} +``` + diff --git a/legacy/doc/models/catalog-query.md b/legacy/doc/models/catalog-query.md new file mode 100644 index 000000000..a0700403f --- /dev/null +++ b/legacy/doc/models/catalog-query.md @@ -0,0 +1,82 @@ + +# Catalog Query + +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](../../doc/api/catalog.md#search-catalog-objects). +Any combination of the following types may be used together: + +- [exact_query](../../doc/models/catalog-query-exact.md) +- [prefix_query](../../doc/models/catalog-query-prefix.md) +- [range_query](../../doc/models/catalog-query-range.md) +- [sorted_attribute_query](../../doc/models/catalog-query-sorted-attribute.md) +- [text_query](../../doc/models/catalog-query-text.md) + +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](../../doc/models/catalog-item.md) objects by searchable attributes, you can use +the `"name"`, `"description"`, or `"abbreviation"` attribute in an applicable query filter. + +## Structure + +`CatalogQuery` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `sortedAttributeQuery` | [`CatalogQuerySortedAttribute \| undefined`](../../doc/models/catalog-query-sorted-attribute.md) | Optional | The query expression to specify the key to sort search results. | +| `exactQuery` | [`CatalogQueryExact \| undefined`](../../doc/models/catalog-query-exact.md) | Optional | The query filter to return the search result by exact match of the specified attribute name and value. | +| `setQuery` | [`CatalogQuerySet \| undefined`](../../doc/models/catalog-query-set.md) | Optional | The query filter to return the search result(s) by exact match of the specified `attribute_name` and any of
the `attribute_values`. | +| `prefixQuery` | [`CatalogQueryPrefix \| undefined`](../../doc/models/catalog-query-prefix.md) | Optional | The query filter to return the search result whose named attribute values are prefixed by the specified attribute value. | +| `rangeQuery` | [`CatalogQueryRange \| undefined`](../../doc/models/catalog-query-range.md) | Optional | The query filter to return the search result whose named attribute values fall between the specified range. | +| `textQuery` | [`CatalogQueryText \| undefined`](../../doc/models/catalog-query-text.md) | Optional | 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. | +| `itemsForTaxQuery` | [`CatalogQueryItemsForTax \| undefined`](../../doc/models/catalog-query-items-for-tax.md) | Optional | The query filter to return the items containing the specified tax IDs. | +| `itemsForModifierListQuery` | [`CatalogQueryItemsForModifierList \| undefined`](../../doc/models/catalog-query-items-for-modifier-list.md) | Optional | The query filter to return the items containing the specified modifier list IDs. | +| `itemsForItemOptionsQuery` | [`CatalogQueryItemsForItemOptions \| undefined`](../../doc/models/catalog-query-items-for-item-options.md) | Optional | The query filter to return the items containing the specified item option IDs. | +| `itemVariationsForItemOptionValuesQuery` | [`CatalogQueryItemVariationsForItemOptionValues \| undefined`](../../doc/models/catalog-query-item-variations-for-item-option-values.md) | Optional | The query filter to return the item variations containing the specified item option value IDs. | + +## Example (as JSON) + +```json +{ + "sorted_attribute_query": { + "attribute_name": "attribute_name0", + "initial_attribute_value": "initial_attribute_value8", + "sort_order": "DESC" + }, + "exact_query": { + "attribute_name": "attribute_name4", + "attribute_value": "attribute_value6" + }, + "set_query": { + "attribute_name": "attribute_name2", + "attribute_values": [ + "attribute_values6" + ] + }, + "prefix_query": { + "attribute_name": "attribute_name6", + "attribute_prefix": "attribute_prefix8" + }, + "range_query": { + "attribute_name": "attribute_name0", + "attribute_min_value": 208, + "attribute_max_value": 138 + } +} +``` + diff --git a/legacy/doc/models/catalog-quick-amount-type.md b/legacy/doc/models/catalog-quick-amount-type.md new file mode 100644 index 000000000..4b35cc8cc --- /dev/null +++ b/legacy/doc/models/catalog-quick-amount-type.md @@ -0,0 +1,16 @@ + +# Catalog Quick Amount Type + +Determines the type of a specific Quick Amount. + +## Enumeration + +`CatalogQuickAmountType` + +## Fields + +| Name | Description | +| --- | --- | +| `QUICK_AMOUNT_TYPE_MANUAL` | Quick Amount is created manually by the seller. | +| `QUICK_AMOUNT_TYPE_AUTO` | Quick Amount is generated automatically by machine learning algorithms. | + diff --git a/legacy/doc/models/catalog-quick-amount.md b/legacy/doc/models/catalog-quick-amount.md new file mode 100644 index 000000000..88354d13c --- /dev/null +++ b/legacy/doc/models/catalog-quick-amount.md @@ -0,0 +1,32 @@ + +# Catalog Quick Amount + +Represents a Quick Amount in the Catalog. + +## Structure + +`CatalogQuickAmount` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `type` | [`string`](../../doc/models/catalog-quick-amount-type.md) | Required | Determines the type of a specific Quick Amount. | +| `amount` | [`Money`](../../doc/models/money.md) | Required | 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. | +| `score` | `bigint \| null \| undefined` | Optional | 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` | `bigint \| null \| undefined` | Optional | The order in which this Quick Amount should be displayed. | + +## Example (as JSON) + +```json +{ + "type": "QUICK_AMOUNT_TYPE_MANUAL", + "amount": { + "amount": 0, + "currency": "LAK" + }, + "score": 12, + "ordinal": 200 +} +``` + diff --git a/legacy/doc/models/catalog-quick-amounts-settings-option.md b/legacy/doc/models/catalog-quick-amounts-settings-option.md new file mode 100644 index 000000000..52672a359 --- /dev/null +++ b/legacy/doc/models/catalog-quick-amounts-settings-option.md @@ -0,0 +1,17 @@ + +# Catalog Quick Amounts Settings Option + +Determines a seller's option on Quick Amounts feature. + +## Enumeration + +`CatalogQuickAmountsSettingsOption` + +## Fields + +| Name | Description | +| --- | --- | +| `DISABLED` | Option for seller to disable Quick Amounts. | +| `MANUAL` | Option for seller to choose manually created Quick Amounts. | +| `AUTO` | Option for seller to choose automatically created Quick Amounts. | + diff --git a/legacy/doc/models/catalog-quick-amounts-settings.md b/legacy/doc/models/catalog-quick-amounts-settings.md new file mode 100644 index 000000000..128d6b1bc --- /dev/null +++ b/legacy/doc/models/catalog-quick-amounts-settings.md @@ -0,0 +1,46 @@ + +# Catalog Quick Amounts Settings + +A parent Catalog Object model represents a set of Quick Amounts and the settings control the amounts. + +## Structure + +`CatalogQuickAmountsSettings` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `option` | [`string`](../../doc/models/catalog-quick-amounts-settings-option.md) | Required | Determines a seller's option on Quick Amounts feature. | +| `eligibleForAutoAmounts` | `boolean \| null \| undefined` | Optional | Represents location's eligibility for auto amounts
The boolean should be consistent with whether there are AUTO amounts in the `amounts`. | +| `amounts` | [`CatalogQuickAmount[] \| null \| undefined`](../../doc/models/catalog-quick-amount.md) | Optional | Represents a set of Quick Amounts at this location. | + +## Example (as JSON) + +```json +{ + "option": "AUTO", + "eligible_for_auto_amounts": false, + "amounts": [ + { + "type": "QUICK_AMOUNT_TYPE_MANUAL", + "amount": { + "amount": 0, + "currency": "LAK" + }, + "score": 116, + "ordinal": 48 + }, + { + "type": "QUICK_AMOUNT_TYPE_MANUAL", + "amount": { + "amount": 0, + "currency": "LAK" + }, + "score": 116, + "ordinal": 48 + } + ] +} +``` + diff --git a/legacy/doc/models/catalog-stock-conversion.md b/legacy/doc/models/catalog-stock-conversion.md new file mode 100644 index 000000000..323476478 --- /dev/null +++ b/legacy/doc/models/catalog-stock-conversion.md @@ -0,0 +1,29 @@ + +# Catalog Stock Conversion + +Represents the rule of conversion between a stockable [CatalogItemVariation](../../doc/models/catalog-item-variation.md) +and a non-stockable sell-by or receive-by `CatalogItemVariation` that +share the same underlying stock. + +## Structure + +`CatalogStockConversion` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `stockableItemVariationId` | `string` | Required | 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.`
**Constraints**: *Minimum Length*: `1` | +| `stockableQuantity` | `string` | Required | 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.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `16` | +| `nonstockableQuantity` | `string` | Required | 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.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `16` | + +## Example (as JSON) + +```json +{ + "stockable_item_variation_id": "stockable_item_variation_id2", + "stockable_quantity": "stockable_quantity0", + "nonstockable_quantity": "nonstockable_quantity2" +} +``` + diff --git a/legacy/doc/models/catalog-subscription-plan-variation.md b/legacy/doc/models/catalog-subscription-plan-variation.md new file mode 100644 index 000000000..5417444ab --- /dev/null +++ b/legacy/doc/models/catalog-subscription-plan-variation.md @@ -0,0 +1,56 @@ + +# Catalog Subscription Plan Variation + +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). + +## Structure + +`CatalogSubscriptionPlanVariation` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `string` | Required | The name of the plan variation. | +| `phases` | [`SubscriptionPhase[]`](../../doc/models/subscription-phase.md) | Required | A list containing each [SubscriptionPhase](entity:SubscriptionPhase) for this plan variation. | +| `subscriptionPlanId` | `string \| null \| undefined` | Optional | The id of the subscription plan, if there is one. | +| `monthlyBillingAnchorDate` | `bigint \| null \| undefined` | Optional | The day of the month the billing period starts.
**Constraints**: `>= 1`, `<= 31` | +| `canProrate` | `boolean \| null \| undefined` | Optional | Whether bills for this plan variation can be split for proration. | +| `successorPlanVariationId` | `string \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "name": "name2", + "phases": [ + { + "uid": "uid0", + "cadence": "QUARTERLY", + "periods": 112, + "recurring_price_money": { + "amount": 66, + "currency": "ZMW" + }, + "ordinal": 78, + "pricing": { + "type": "STATIC", + "discount_ids": [ + "discount_ids5", + "discount_ids6" + ], + "price_money": { + "amount": 202, + "currency": "GTQ" + } + } + } + ], + "subscription_plan_id": "subscription_plan_id0", + "monthly_billing_anchor_date": 38, + "can_prorate": false, + "successor_plan_variation_id": "successor_plan_variation_id2" +} +``` + diff --git a/legacy/doc/models/catalog-subscription-plan.md b/legacy/doc/models/catalog-subscription-plan.md new file mode 100644 index 000000000..d998307dc --- /dev/null +++ b/legacy/doc/models/catalog-subscription-plan.md @@ -0,0 +1,194 @@ + +# Catalog Subscription Plan + +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). + +## Structure + +`CatalogSubscriptionPlan` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `string` | Required | The name of the plan. | +| `phases` | [`SubscriptionPhase[] \| null \| undefined`](../../doc/models/subscription-phase.md) | Optional | 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 | +| `subscriptionPlanVariations` | [`CatalogObject[] \| null \| undefined`](../../doc/models/catalog-object.md) | Optional | The list of subscription plan variations available for this product | +| `eligibleItemIds` | `string[] \| null \| undefined` | Optional | The list of IDs of `CatalogItems` that are eligible for subscription by this SubscriptionPlan's variations. | +| `eligibleCategoryIds` | `string[] \| null \| undefined` | Optional | The list of IDs of `CatalogCategory` that are eligible for subscription by this SubscriptionPlan's variations. | +| `allItems` | `boolean \| null \| undefined` | Optional | If true, all items in the merchant's catalog are subscribable by this SubscriptionPlan. | + +## Example (as JSON) + +```json +{ + "name": "name6", + "phases": [ + { + "uid": "uid0", + "cadence": "QUARTERLY", + "periods": 112, + "recurring_price_money": { + "amount": 66, + "currency": "ZMW" + }, + "ordinal": 78, + "pricing": { + "type": "STATIC", + "discount_ids": [ + "discount_ids5", + "discount_ids6" + ], + "price_money": { + "amount": 202, + "currency": "GTQ" + } + } + }, + { + "uid": "uid0", + "cadence": "QUARTERLY", + "periods": 112, + "recurring_price_money": { + "amount": 66, + "currency": "ZMW" + }, + "ordinal": 78, + "pricing": { + "type": "STATIC", + "discount_ids": [ + "discount_ids5", + "discount_ids6" + ], + "price_money": { + "amount": 202, + "currency": "GTQ" + } + } + }, + { + "uid": "uid0", + "cadence": "QUARTERLY", + "periods": 112, + "recurring_price_money": { + "amount": 66, + "currency": "ZMW" + }, + "ordinal": 78, + "pricing": { + "type": "STATIC", + "discount_ids": [ + "discount_ids5", + "discount_ids6" + ], + "price_money": { + "amount": 202, + "currency": "GTQ" + } + } + } + ], + "subscription_plan_variations": [ + { + "type": "MODIFIER", + "id": "id4", + "updated_at": "updated_at0", + "version": 208, + "is_deleted": false, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key2": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] + }, + { + "type": "MODIFIER", + "id": "id4", + "updated_at": "updated_at0", + "version": 208, + "is_deleted": false, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key2": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] + } + ], + "eligible_item_ids": [ + "eligible_item_ids8", + "eligible_item_ids7" + ], + "eligible_category_ids": [ + "eligible_category_ids5", + "eligible_category_ids6", + "eligible_category_ids7" + ], + "all_items": false +} +``` + diff --git a/legacy/doc/models/catalog-tax.md b/legacy/doc/models/catalog-tax.md new file mode 100644 index 000000000..56eb0eac3 --- /dev/null +++ b/legacy/doc/models/catalog-tax.md @@ -0,0 +1,46 @@ + +# Catalog Tax + +A tax applicable to an item. + +## Structure + +`CatalogTax` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `string \| null \| undefined` | Optional | The tax's name. This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points.
**Constraints**: *Maximum Length*: `255` | +| `calculationPhase` | [`string \| undefined`](../../doc/models/tax-calculation-phase.md) | Optional | When to calculate the taxes due on a cart. | +| `inclusionType` | [`string \| undefined`](../../doc/models/tax-inclusion-type.md) | Optional | Whether to the tax amount should be additional to or included in the CatalogItem price. | +| `percentage` | `string \| null \| undefined` | Optional | 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. | +| `appliesToCustomAmounts` | `boolean \| null \| undefined` | Optional | 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` | `boolean \| null \| undefined` | Optional | A Boolean flag to indicate whether the tax is displayed as enabled (`true`) in the Square Point of Sale app or not (`false`). | +| `appliesToProductSetId` | `string \| null \| undefined` | Optional | The ID of a `CatalogProductSet` object. If set, the tax is applicable to all products in the product set. | + +## Example (as JSON) + +```json +{ + "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" + }, + "name": "name2", + "calculation_phase": "TAX_SUBTOTAL_PHASE", + "inclusion_type": "ADDITIVE", + "percentage": "percentage0", + "applies_to_custom_amounts": false +} +``` + diff --git a/legacy/doc/models/catalog-time-period.md b/legacy/doc/models/catalog-time-period.md new file mode 100644 index 000000000..945c426be --- /dev/null +++ b/legacy/doc/models/catalog-time-period.md @@ -0,0 +1,23 @@ + +# Catalog Time Period + +Represents a time period - either a single period or a repeating period. + +## Structure + +`CatalogTimePeriod` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `event` | `string \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "event": "event8" +} +``` + diff --git a/legacy/doc/models/catalog-v1-id.md b/legacy/doc/models/catalog-v1-id.md new file mode 100644 index 000000000..614782cc3 --- /dev/null +++ b/legacy/doc/models/catalog-v1-id.md @@ -0,0 +1,25 @@ + +# Catalog V1 Id + +A Square API V1 identifier of an item, including the object ID and its associated location ID. + +## Structure + +`CatalogV1Id` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `catalogV1Id` | `string \| null \| undefined` | Optional | The ID for an object used in the Square API V1, if the object ID differs from the Square API V2 object ID. | +| `locationId` | `string \| null \| undefined` | Optional | The ID of the `Location` this Connect V1 ID is associated with. | + +## Example (as JSON) + +```json +{ + "catalog_v1_id": "catalog_v1_id2", + "location_id": "location_id2" +} +``` + diff --git a/legacy/doc/models/category-path-to-root-node.md b/legacy/doc/models/category-path-to-root-node.md new file mode 100644 index 000000000..309cf29b6 --- /dev/null +++ b/legacy/doc/models/category-path-to-root-node.md @@ -0,0 +1,25 @@ + +# Category Path to Root Node + +A node in the path from a retrieved category to its root node. + +## Structure + +`CategoryPathToRootNode` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `categoryId` | `string \| null \| undefined` | Optional | The category's ID. | +| `categoryName` | `string \| null \| undefined` | Optional | The category's name. | + +## Example (as JSON) + +```json +{ + "category_id": "category_id0", + "category_name": "category_name0" +} +``` + diff --git a/legacy/doc/models/change-billing-anchor-date-request.md b/legacy/doc/models/change-billing-anchor-date-request.md new file mode 100644 index 000000000..dbfa4745e --- /dev/null +++ b/legacy/doc/models/change-billing-anchor-date-request.md @@ -0,0 +1,26 @@ + +# Change Billing Anchor Date Request + +Defines input parameters in a request to the +[ChangeBillingAnchorDate](../../doc/api/subscriptions.md#change-billing-anchor-date) endpoint. + +## Structure + +`ChangeBillingAnchorDateRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `monthlyBillingAnchorDate` | `number \| null \| undefined` | Optional | The anchor day for the billing cycle.
**Constraints**: `>= 1`, `<= 31` | +| `effectiveDate` | `string \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "monthly_billing_anchor_date": 1, + "effective_date": "effective_date8" +} +``` + diff --git a/legacy/doc/models/change-billing-anchor-date-response.md b/legacy/doc/models/change-billing-anchor-date-response.md new file mode 100644 index 000000000..cea478b9f --- /dev/null +++ b/legacy/doc/models/change-billing-anchor-date-response.md @@ -0,0 +1,94 @@ + +# Change Billing Anchor Date Response + +Defines output parameters in a request to the +[ChangeBillingAnchorDate](../../doc/api/subscriptions.md#change-billing-anchor-date) endpoint. + +## Structure + +`ChangeBillingAnchorDateResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Errors encountered during the request. | +| `subscription` | [`Subscription \| undefined`](../../doc/models/subscription.md) | Optional | Represents a subscription purchased by a customer.

For more information, see
[Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). | +| `actions` | [`SubscriptionAction[] \| undefined`](../../doc/models/subscription-action.md) | Optional | A list of a single billing anchor date change for the subscription. | + +## Example (as JSON) + +```json +{ + "actions": [ + { + "effective_date": "2023-11-01", + "id": "f0a1dfdc-675b-3a14-a640-99f7ac1cee83", + "monthly_billing_anchor_date": 1, + "type": "CHANGE_BILLING_ANCHOR_DATE", + "phases": [ + { + "uid": "uid0", + "ordinal": 78, + "order_template_id": "order_template_id2", + "plan_phase_uid": "plan_phase_uid6" + }, + { + "uid": "uid0", + "ordinal": 78, + "order_template_id": "order_template_id2", + "plan_phase_uid": "plan_phase_uid6" + }, + { + "uid": "uid0", + "ordinal": 78, + "order_template_id": "order_template_id2", + "plan_phase_uid": "plan_phase_uid6" + } + ] + } + ], + "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, + "start_date": "start_date8" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/change-timing.md b/legacy/doc/models/change-timing.md new file mode 100644 index 000000000..1934eb99d --- /dev/null +++ b/legacy/doc/models/change-timing.md @@ -0,0 +1,16 @@ + +# Change Timing + +Supported timings when a pending change, as an action, takes place to a subscription. + +## Enumeration + +`ChangeTiming` + +## Fields + +| Name | Description | +| --- | --- | +| `IMMEDIATE` | The action occurs immediately. | +| `END_OF_BILLING_CYCLE` | The action occurs at the end of the billing cycle. | + diff --git a/legacy/doc/models/charge-request-additional-recipient.md b/legacy/doc/models/charge-request-additional-recipient.md new file mode 100644 index 000000000..bf487136d --- /dev/null +++ b/legacy/doc/models/charge-request-additional-recipient.md @@ -0,0 +1,31 @@ + +# Charge Request Additional Recipient + +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 + +## Structure + +`ChargeRequestAdditionalRecipient` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string` | Required | The location ID for a recipient (other than the merchant) receiving a portion of the tender.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `50` | +| `description` | `string` | Required | The description of the additional recipient.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `100` | +| `amountMoney` | [`Money`](../../doc/models/money.md) | Required | 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. | + +## Example (as JSON) + +```json +{ + "location_id": "location_id6", + "description": "description2", + "amount_money": { + "amount": 186, + "currency": "AUD" + } +} +``` + diff --git a/legacy/doc/models/charge-request.md b/legacy/doc/models/charge-request.md new file mode 100644 index 000000000..399e01bf3 --- /dev/null +++ b/legacy/doc/models/charge-request.md @@ -0,0 +1,73 @@ + +# Charge Request + +Defines the parameters that can be included in the body of +a request to the [Charge](api-endpoint:Transactions-Charge) endpoint. + +Deprecated - recommend using [CreatePayment](api-endpoint:Payments-CreatePayment) + +## Structure + +`ChargeRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string` | Required | A value you specify that uniquely identifies this
transaction among transactions you've created.

If you're unsure whether a particular transaction succeeded,
you can reattempt it with the same idempotency key without
worrying about double-charging the buyer.

See [Idempotency keys](https://developer.squareup.com/docs/working-with-apis/idempotency) for more information.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `192` | +| `amountMoney` | [`Money`](../../doc/models/money.md) | Required | 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. | +| `cardNonce` | `string \| null \| undefined` | Optional | A payment token generated from the [Card.tokenize()](https://developer.squareup.com/reference/sdks/web/payments/objects/Card#Card.tokenize) that represents the card
to charge.

The application that provides a payment token to this endpoint must be the
_same application_ that generated the payment token with the Web Payments SDK.
Otherwise, the nonce is invalid.

Do not provide a value for this field if you provide a value for
`customer_card_id`.
**Constraints**: *Maximum Length*: `192` | +| `customerCardId` | `string \| null \| undefined` | Optional | The ID of the customer card on file to charge. Do
not provide a value for this field if you provide a value for `card_nonce`.

If you provide this value, you _must_ also provide a value for
`customer_id`.
**Constraints**: *Maximum Length*: `192` | +| `delayCapture` | `boolean \| null \| undefined` | Optional | If `true`, the request will only perform an Auth on the provided
card. You can then later perform either a Capture (with the
[CaptureTransaction](api-endpoint:Transactions-CaptureTransaction) endpoint) or a Void
(with the [VoidTransaction](api-endpoint:Transactions-VoidTransaction) endpoint).

Default value: `false` | +| `referenceId` | `string \| null \| undefined` | Optional | An optional ID you can associate with the transaction for your own
purposes (such as to associate the transaction with an entity ID in your
own database).

This value cannot exceed 40 characters.
**Constraints**: *Maximum Length*: `40` | +| `note` | `string \| null \| undefined` | Optional | An optional note to associate with the transaction.

This value cannot exceed 60 characters.
**Constraints**: *Maximum Length*: `60` | +| `customerId` | `string \| null \| undefined` | Optional | The ID of the customer to associate this transaction with. This field
is required if you provide a value for `customer_card_id`, and optional
otherwise.
**Constraints**: *Maximum Length*: `50` | +| `billingAddress` | [`Address \| undefined`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | +| `shippingAddress` | [`Address \| undefined`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | +| `buyerEmailAddress` | `string \| null \| undefined` | Optional | The buyer's email address, if available. This value is optional,
but this transaction is ineligible for chargeback protection if it is not
provided. | +| `orderId` | `string \| null \| undefined` | Optional | The ID of the order to associate with this transaction.

If you provide this value, the `amount_money` value of your request must
__exactly match__ the value of the order's `total_money` field.
**Constraints**: *Maximum Length*: `192` | +| `additionalRecipients` | [`ChargeRequestAdditionalRecipient[] \| null \| undefined`](../../doc/models/charge-request-additional-recipient.md) | Optional | The basic primitive of multi-party transaction. The value is optional.
The transaction facilitated by you can be split from here.

If you provide this value, the `amount_money` value in your additional_recipients
must not be more than 90% of the `amount_money` value in the charge request.
The `location_id` must be the valid location of the app owner merchant.

This field requires the `PAYMENTS_WRITE_ADDITIONAL_RECIPIENTS` OAuth permission.

This field is currently not supported in sandbox. | +| `verificationToken` | `string \| null \| undefined` | Optional | A token generated by SqPaymentForm's verifyBuyer() that represents
customer's device info and 3ds challenge result. | + +## Example (as JSON) + +```json +{ + "additional_recipients": [ + { + "amount_money": { + "amount": 20, + "currency": "USD" + }, + "description": "Application fees", + "location_id": "057P5VYJ4A5X1" + } + ], + "amount_money": { + "amount": 200, + "currency": "USD" + }, + "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": "card_nonce_from_square_123", + "delay_capture": false, + "idempotency_key": "74ae1696-b1e3-4328-af6d-f1e04d947a13", + "note": "some optional note", + "reference_id": "some optional reference id", + "shipping_address": { + "address_line_1": "123 Main St", + "administrative_district_level_1": "CA", + "country": "US", + "locality": "San Francisco", + "postal_code": "94114" + }, + "customer_card_id": "customer_card_id0" +} +``` + diff --git a/legacy/doc/models/charge-response.md b/legacy/doc/models/charge-response.md new file mode 100644 index 000000000..52fabd5f2 --- /dev/null +++ b/legacy/doc/models/charge-response.md @@ -0,0 +1,187 @@ + +# Charge Response + +Defines the fields that are included in the response body of +a request to the [Charge](api-endpoint:Transactions-Charge) endpoint. + +One of `errors` or `transaction` is present in a given response (never both). + +## Structure + +`ChargeResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `transaction` | [`Transaction \| undefined`](../../doc/models/transaction.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "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", + "receivable_id": "ISu5xwxJ5v0CMJTQq7RvqyMF" + } + ], + "amount_money": { + "amount": 200, + "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", + "transaction_id": "KnL67ZIwXCPtzOrqj0HrkxMF", + "type": "CARD" + } + ], + "refunds": [ + { + "id": "id8", + "location_id": "location_id2", + "transaction_id": "transaction_id6", + "tender_id": "tender_id6", + "created_at": "created_at6", + "reason": "reason4", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "status": "PENDING", + "processing_fee_money": { + "amount": 112, + "currency": "DJF" + }, + "additional_recipients": [ + { + "location_id": "location_id0", + "description": "description6", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "receivable_id": "receivable_id6" + }, + { + "location_id": "location_id0", + "description": "description6", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "receivable_id": "receivable_id6" + } + ] + }, + { + "id": "id8", + "location_id": "location_id2", + "transaction_id": "transaction_id6", + "tender_id": "tender_id6", + "created_at": "created_at6", + "reason": "reason4", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "status": "PENDING", + "processing_fee_money": { + "amount": 112, + "currency": "DJF" + }, + "additional_recipients": [ + { + "location_id": "location_id0", + "description": "description6", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "receivable_id": "receivable_id6" + }, + { + "location_id": "location_id0", + "description": "description6", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "receivable_id": "receivable_id6" + } + ] + }, + { + "id": "id8", + "location_id": "location_id2", + "transaction_id": "transaction_id6", + "tender_id": "tender_id6", + "created_at": "created_at6", + "reason": "reason4", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "status": "PENDING", + "processing_fee_money": { + "amount": 112, + "currency": "DJF" + }, + "additional_recipients": [ + { + "location_id": "location_id0", + "description": "description6", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "receivable_id": "receivable_id6" + }, + { + "location_id": "location_id0", + "description": "description6", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "receivable_id": "receivable_id6" + } + ] + } + ] + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/checkout-location-settings-branding-button-shape.md b/legacy/doc/models/checkout-location-settings-branding-button-shape.md new file mode 100644 index 000000000..788cac88e --- /dev/null +++ b/legacy/doc/models/checkout-location-settings-branding-button-shape.md @@ -0,0 +1,15 @@ + +# Checkout Location Settings Branding Button Shape + +## Enumeration + +`CheckoutLocationSettingsBrandingButtonShape` + +## Fields + +| Name | +| --- | +| `SQUARED` | +| `ROUNDED` | +| `PILL` | + diff --git a/legacy/doc/models/checkout-location-settings-branding-header-type.md b/legacy/doc/models/checkout-location-settings-branding-header-type.md new file mode 100644 index 000000000..b78204a8f --- /dev/null +++ b/legacy/doc/models/checkout-location-settings-branding-header-type.md @@ -0,0 +1,15 @@ + +# Checkout Location Settings Branding Header Type + +## Enumeration + +`CheckoutLocationSettingsBrandingHeaderType` + +## Fields + +| Name | +| --- | +| `BUSINESS_NAME` | +| `FRAMED_LOGO` | +| `FULL_WIDTH_LOGO` | + diff --git a/legacy/doc/models/checkout-location-settings-branding.md b/legacy/doc/models/checkout-location-settings-branding.md new file mode 100644 index 000000000..eb7bacea8 --- /dev/null +++ b/legacy/doc/models/checkout-location-settings-branding.md @@ -0,0 +1,25 @@ + +# Checkout Location Settings Branding + +## Structure + +`CheckoutLocationSettingsBranding` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `headerType` | [`string \| undefined`](../../doc/models/checkout-location-settings-branding-header-type.md) | Optional | - | +| `buttonColor` | `string \| null \| undefined` | Optional | The HTML-supported hex color for the button on the checkout page (for example, "#FFFFFF").
**Constraints**: *Minimum Length*: `7`, *Maximum Length*: `7` | +| `buttonShape` | [`string \| undefined`](../../doc/models/checkout-location-settings-branding-button-shape.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "header_type": "FULL_WIDTH_LOGO", + "button_color": "button_color2", + "button_shape": "ROUNDED" +} +``` + diff --git a/legacy/doc/models/checkout-location-settings-coupons.md b/legacy/doc/models/checkout-location-settings-coupons.md new file mode 100644 index 000000000..54c4b9cfd --- /dev/null +++ b/legacy/doc/models/checkout-location-settings-coupons.md @@ -0,0 +1,21 @@ + +# Checkout Location Settings Coupons + +## Structure + +`CheckoutLocationSettingsCoupons` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `enabled` | `boolean \| null \| undefined` | Optional | Indicates whether coupons are enabled for this location. | + +## Example (as JSON) + +```json +{ + "enabled": false +} +``` + diff --git a/legacy/doc/models/checkout-location-settings-policy.md b/legacy/doc/models/checkout-location-settings-policy.md new file mode 100644 index 000000000..c19053d0c --- /dev/null +++ b/legacy/doc/models/checkout-location-settings-policy.md @@ -0,0 +1,25 @@ + +# Checkout Location Settings Policy + +## Structure + +`CheckoutLocationSettingsPolicy` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string \| null \| undefined` | Optional | 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` | `string \| null \| undefined` | Optional | The title of the policy. This is required when setting the description, though you can update it in a different request.
**Constraints**: *Maximum Length*: `50` | +| `description` | `string \| null \| undefined` | Optional | The description of the policy.
**Constraints**: *Maximum Length*: `4096` | + +## Example (as JSON) + +```json +{ + "uid": "uid0", + "title": "title6", + "description": "description0" +} +``` + diff --git a/legacy/doc/models/checkout-location-settings-tipping.md b/legacy/doc/models/checkout-location-settings-tipping.md new file mode 100644 index 000000000..e4ca7380f --- /dev/null +++ b/legacy/doc/models/checkout-location-settings-tipping.md @@ -0,0 +1,48 @@ + +# Checkout Location Settings Tipping + +## Structure + +`CheckoutLocationSettingsTipping` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `percentages` | `number[] \| null \| undefined` | Optional | 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. | +| `smartTippingEnabled` | `boolean \| null \| undefined` | Optional | 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. | +| `defaultPercent` | `number \| null \| undefined` | Optional | Set the pre-selected percentage amounts that appear at checkout. If Smart Tip is enabled, this only applies to transactions totaling $10 or more. | +| `smartTips` | [`Money[] \| null \| undefined`](../../doc/models/money.md) | Optional | Show the Smart Tip Amounts for this location. | +| `defaultSmartTip` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "percentages": [ + 192, + 193 + ], + "smart_tipping_enabled": false, + "default_percent": 72, + "smart_tips": [ + { + "amount": 152, + "currency": "GEL" + }, + { + "amount": 152, + "currency": "GEL" + }, + { + "amount": 152, + "currency": "GEL" + } + ], + "default_smart_tip": { + "amount": 58, + "currency": "KWD" + } +} +``` + diff --git a/legacy/doc/models/checkout-location-settings.md b/legacy/doc/models/checkout-location-settings.md new file mode 100644 index 000000000..d5298c903 --- /dev/null +++ b/legacy/doc/models/checkout-location-settings.md @@ -0,0 +1,67 @@ + +# Checkout Location Settings + +## Structure + +`CheckoutLocationSettings` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string \| null \| undefined` | Optional | The ID of the location that these settings apply to. | +| `customerNotesEnabled` | `boolean \| null \| undefined` | Optional | Indicates whether customers are allowed to leave notes at checkout. | +| `policies` | [`CheckoutLocationSettingsPolicy[] \| null \| undefined`](../../doc/models/checkout-location-settings-policy.md) | Optional | Policy information is displayed at the bottom of the checkout pages.
You can set a maximum of two policies. | +| `branding` | [`CheckoutLocationSettingsBranding \| undefined`](../../doc/models/checkout-location-settings-branding.md) | Optional | - | +| `tipping` | [`CheckoutLocationSettingsTipping \| undefined`](../../doc/models/checkout-location-settings-tipping.md) | Optional | - | +| `coupons` | [`CheckoutLocationSettingsCoupons \| undefined`](../../doc/models/checkout-location-settings-coupons.md) | Optional | - | +| `updatedAt` | `string \| undefined` | Optional | 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 | + +## Example (as JSON) + +```json +{ + "location_id": "location_id4", + "customer_notes_enabled": false, + "policies": [ + { + "uid": "uid8", + "title": "title4", + "description": "description8" + }, + { + "uid": "uid8", + "title": "title4", + "description": "description8" + } + ], + "branding": { + "header_type": "FULL_WIDTH_LOGO", + "button_color": "button_color2", + "button_shape": "PILL" + }, + "tipping": { + "percentages": [ + 246, + 247 + ], + "smart_tipping_enabled": false, + "default_percent": 46, + "smart_tips": [ + { + "amount": 152, + "currency": "GEL" + }, + { + "amount": 152, + "currency": "GEL" + } + ], + "default_smart_tip": { + "amount": 58, + "currency": "KWD" + } + } +} +``` + diff --git a/legacy/doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay-eligibility-range.md b/legacy/doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay-eligibility-range.md new file mode 100644 index 000000000..97a1a0a75 --- /dev/null +++ b/legacy/doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay-eligibility-range.md @@ -0,0 +1,31 @@ + +# Checkout Merchant Settings Payment Methods Afterpay Clearpay Eligibility Range + +A range of purchase price that qualifies. + +## Structure + +`CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `min` | [`Money`](../../doc/models/money.md) | Required | 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. | +| `max` | [`Money`](../../doc/models/money.md) | Required | 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. | + +## Example (as JSON) + +```json +{ + "min": { + "amount": 34, + "currency": "OMR" + }, + "max": { + "amount": 140, + "currency": "JPY" + } +} +``` + diff --git a/legacy/doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay.md b/legacy/doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay.md new file mode 100644 index 000000000..1cad1486b --- /dev/null +++ b/legacy/doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay.md @@ -0,0 +1,45 @@ + +# Checkout Merchant Settings Payment Methods Afterpay Clearpay + +The settings allowed for AfterpayClearpay. + +## Structure + +`CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `orderEligibilityRange` | [`CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange \| undefined`](../../doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay-eligibility-range.md) | Optional | A range of purchase price that qualifies. | +| `itemEligibilityRange` | [`CheckoutMerchantSettingsPaymentMethodsAfterpayClearpayEligibilityRange \| undefined`](../../doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay-eligibility-range.md) | Optional | A range of purchase price that qualifies. | +| `enabled` | `boolean \| undefined` | Optional | Indicates whether the payment method is enabled for the account. | + +## Example (as JSON) + +```json +{ + "order_eligibility_range": { + "min": { + "amount": 34, + "currency": "OMR" + }, + "max": { + "amount": 140, + "currency": "JPY" + } + }, + "item_eligibility_range": { + "min": { + "amount": 34, + "currency": "OMR" + }, + "max": { + "amount": 140, + "currency": "JPY" + } + }, + "enabled": false +} +``` + diff --git a/legacy/doc/models/checkout-merchant-settings-payment-methods-payment-method.md b/legacy/doc/models/checkout-merchant-settings-payment-methods-payment-method.md new file mode 100644 index 000000000..1a9f728b9 --- /dev/null +++ b/legacy/doc/models/checkout-merchant-settings-payment-methods-payment-method.md @@ -0,0 +1,23 @@ + +# Checkout Merchant Settings Payment Methods Payment Method + +The settings allowed for a payment method. + +## Structure + +`CheckoutMerchantSettingsPaymentMethodsPaymentMethod` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `enabled` | `boolean \| null \| undefined` | Optional | Indicates whether the payment method is enabled for the account. | + +## Example (as JSON) + +```json +{ + "enabled": false +} +``` + diff --git a/legacy/doc/models/checkout-merchant-settings-payment-methods.md b/legacy/doc/models/checkout-merchant-settings-payment-methods.md new file mode 100644 index 000000000..3cf871bac --- /dev/null +++ b/legacy/doc/models/checkout-merchant-settings-payment-methods.md @@ -0,0 +1,55 @@ + +# Checkout Merchant Settings Payment Methods + +## Structure + +`CheckoutMerchantSettingsPaymentMethods` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `applePay` | [`CheckoutMerchantSettingsPaymentMethodsPaymentMethod \| undefined`](../../doc/models/checkout-merchant-settings-payment-methods-payment-method.md) | Optional | The settings allowed for a payment method. | +| `googlePay` | [`CheckoutMerchantSettingsPaymentMethodsPaymentMethod \| undefined`](../../doc/models/checkout-merchant-settings-payment-methods-payment-method.md) | Optional | The settings allowed for a payment method. | +| `cashApp` | [`CheckoutMerchantSettingsPaymentMethodsPaymentMethod \| undefined`](../../doc/models/checkout-merchant-settings-payment-methods-payment-method.md) | Optional | The settings allowed for a payment method. | +| `afterpayClearpay` | [`CheckoutMerchantSettingsPaymentMethodsAfterpayClearpay \| undefined`](../../doc/models/checkout-merchant-settings-payment-methods-afterpay-clearpay.md) | Optional | The settings allowed for AfterpayClearpay. | + +## Example (as JSON) + +```json +{ + "apple_pay": { + "enabled": false + }, + "google_pay": { + "enabled": false + }, + "cash_app": { + "enabled": false + }, + "afterpay_clearpay": { + "order_eligibility_range": { + "min": { + "amount": 34, + "currency": "OMR" + }, + "max": { + "amount": 140, + "currency": "JPY" + } + }, + "item_eligibility_range": { + "min": { + "amount": 34, + "currency": "OMR" + }, + "max": { + "amount": 140, + "currency": "JPY" + } + }, + "enabled": false + } +} +``` + diff --git a/legacy/doc/models/checkout-merchant-settings.md b/legacy/doc/models/checkout-merchant-settings.md new file mode 100644 index 000000000..e690dcbc4 --- /dev/null +++ b/legacy/doc/models/checkout-merchant-settings.md @@ -0,0 +1,56 @@ + +# Checkout Merchant Settings + +## Structure + +`CheckoutMerchantSettings` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `paymentMethods` | [`CheckoutMerchantSettingsPaymentMethods \| undefined`](../../doc/models/checkout-merchant-settings-payment-methods.md) | Optional | - | +| `updatedAt` | `string \| undefined` | Optional | 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 | + +## Example (as JSON) + +```json +{ + "payment_methods": { + "apple_pay": { + "enabled": false + }, + "google_pay": { + "enabled": false + }, + "cash_app": { + "enabled": false + }, + "afterpay_clearpay": { + "order_eligibility_range": { + "min": { + "amount": 34, + "currency": "OMR" + }, + "max": { + "amount": 140, + "currency": "JPY" + } + }, + "item_eligibility_range": { + "min": { + "amount": 34, + "currency": "OMR" + }, + "max": { + "amount": 140, + "currency": "JPY" + } + }, + "enabled": false + } + }, + "updated_at": "updated_at0" +} +``` + diff --git a/legacy/doc/models/checkout-options-payment-type.md b/legacy/doc/models/checkout-options-payment-type.md new file mode 100644 index 000000000..3ea1b1cef --- /dev/null +++ b/legacy/doc/models/checkout-options-payment-type.md @@ -0,0 +1,20 @@ + +# Checkout Options Payment Type + +## Enumeration + +`CheckoutOptionsPaymentType` + +## Fields + +| Name | Description | +| --- | --- | +| `CARD_PRESENT` | Accept credit card or debit card payments via tap, dip or swipe. | +| `MANUAL_CARD_ENTRY` | Launches the manual credit or debit card entry screen for the buyer to complete. | +| `FELICA_ID` | Launches the iD checkout screen for the buyer to complete. | +| `FELICA_QUICPAY` | Launches the QUICPay checkout screen for the buyer to complete. | +| `FELICA_TRANSPORTATION_GROUP` | Launches the Transportation Group checkout screen for the buyer to complete. | +| `FELICA_ALL` | Launches a checkout screen for the buyer on the Square Terminal that
allows them to select a specific FeliCa brand or select the check balance screen. | +| `PAYPAY` | Replaced by `QR_CODE`. | +| `QR_CODE` | Launches Square's QR Code checkout screen for the buyer to complete.
Displays a single code that supports all digital wallets connected to the target
Seller location (e.g. PayPay) | + diff --git a/legacy/doc/models/checkout-options.md b/legacy/doc/models/checkout-options.md new file mode 100644 index 000000000..88cee9dc0 --- /dev/null +++ b/legacy/doc/models/checkout-options.md @@ -0,0 +1,45 @@ + +# Checkout Options + +## Structure + +`CheckoutOptions` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `allowTipping` | `boolean \| null \| undefined` | Optional | Indicates whether the payment allows tipping. | +| `customFields` | [`CustomField[] \| null \| undefined`](../../doc/models/custom-field.md) | Optional | The custom fields requesting information from the buyer. | +| `subscriptionPlanId` | `string \| null \| undefined` | Optional | 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).
**Constraints**: *Maximum Length*: `255` | +| `redirectUrl` | `string \| null \| undefined` | Optional | The confirmation page URL to redirect the buyer to after Square processes the payment.
**Constraints**: *Maximum Length*: `2048` | +| `merchantSupportEmail` | `string \| null \| undefined` | Optional | The email address that buyers can use to contact the seller.
**Constraints**: *Maximum Length*: `256` | +| `askForShippingAddress` | `boolean \| null \| undefined` | Optional | Indicates whether to include the address fields in the payment form. | +| `acceptedPaymentMethods` | [`AcceptedPaymentMethods \| undefined`](../../doc/models/accepted-payment-methods.md) | Optional | - | +| `appFeeMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `shippingFee` | [`ShippingFee \| undefined`](../../doc/models/shipping-fee.md) | Optional | - | +| `enableCoupon` | `boolean \| null \| undefined` | Optional | Indicates whether to include the `Add coupon` section for the buyer to provide a Square marketing coupon in the payment form. | +| `enableLoyalty` | `boolean \| null \| undefined` | Optional | Indicates whether to include the `REWARDS` section for the buyer to opt in to loyalty, redeem rewards in the payment form, or both. | + +## Example (as JSON) + +```json +{ + "allow_tipping": false, + "custom_fields": [ + { + "title": "title8" + }, + { + "title": "title8" + }, + { + "title": "title8" + } + ], + "subscription_plan_id": "subscription_plan_id0", + "redirect_url": "redirect_url4", + "merchant_support_email": "merchant_support_email0" +} +``` + diff --git a/legacy/doc/models/checkout.md b/legacy/doc/models/checkout.md new file mode 100644 index 000000000..aa4e63075 --- /dev/null +++ b/legacy/doc/models/checkout.md @@ -0,0 +1,37 @@ + +# Checkout + +Square Checkout lets merchants accept online payments for supported +payment types using a checkout workflow hosted on squareup.com. + +## Structure + +`Checkout` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | ID generated by Square Checkout when a new checkout is requested. | +| `checkoutPageUrl` | `string \| null \| undefined` | Optional | The URL that the buyer's browser should be redirected to after the
checkout is completed. | +| `askForShippingAddress` | `boolean \| null \| undefined` | Optional | 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`. | +| `merchantSupportEmail` | `string \| null \| undefined` | Optional | 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. | +| `prePopulateBuyerEmail` | `string \| null \| undefined` | Optional | 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. | +| `prePopulateShippingAddress` | [`Address \| undefined`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | +| `redirectUrl` | `string \| null \| undefined` | Optional | 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` | [`Order \| undefined`](../../doc/models/order.md) | Optional | 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. | +| `createdAt` | `string \| undefined` | Optional | The time when the checkout was created, in RFC 3339 format. | +| `additionalRecipients` | [`AdditionalRecipient[] \| null \| undefined`](../../doc/models/additional-recipient.md) | Optional | Additional recipients (other than the merchant) receiving a portion of this checkout.
For example, fees assessed on the purchase by a third party integration. | + +## Example (as JSON) + +```json +{ + "id": "id0", + "checkout_page_url": "checkout_page_url4", + "ask_for_shipping_address": false, + "merchant_support_email": "merchant_support_email8", + "pre_populate_buyer_email": "pre_populate_buyer_email2" +} +``` + diff --git a/legacy/doc/models/clearpay-details.md b/legacy/doc/models/clearpay-details.md new file mode 100644 index 000000000..5f7242740 --- /dev/null +++ b/legacy/doc/models/clearpay-details.md @@ -0,0 +1,23 @@ + +# Clearpay Details + +Additional details about Clearpay payments. + +## Structure + +`ClearpayDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `emailAddress` | `string \| null \| undefined` | Optional | Email address on the buyer's Clearpay account.
**Constraints**: *Maximum Length*: `255` | + +## Example (as JSON) + +```json +{ + "email_address": "email_address6" +} +``` + diff --git a/legacy/doc/models/clone-order-request.md b/legacy/doc/models/clone-order-request.md new file mode 100644 index 000000000..cd967a3bf --- /dev/null +++ b/legacy/doc/models/clone-order-request.md @@ -0,0 +1,28 @@ + +# Clone Order Request + +Defines the fields that are included in requests to the +[CloneOrder](../../doc/api/orders.md#clone-order) endpoint. + +## Structure + +`CloneOrderRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `orderId` | `string` | Required | The ID of the order to clone. | +| `version` | `number \| undefined` | Optional | 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. | +| `idempotencyKey` | `string \| null \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "idempotency_key": "UNIQUE_STRING", + "order_id": "ZAISEM52YcpmcWAzERDOyiWS123", + "version": 3 +} +``` + diff --git a/legacy/doc/models/clone-order-response.md b/legacy/doc/models/clone-order-response.md new file mode 100644 index 000000000..a1acf1a7f --- /dev/null +++ b/legacy/doc/models/clone-order-response.md @@ -0,0 +1,333 @@ + +# Clone Order Response + +Defines the fields that are included in the response body of +a request to the [CloneOrder](../../doc/api/orders.md#clone-order) endpoint. + +## Structure + +`CloneOrderResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `order` | [`Order \| undefined`](../../doc/models/order.md) | Optional | 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. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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" + }, + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note4", + "catalog_object_id": "catalog_object_id2" + }, + { + "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" + }, + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note4" + } + ], + "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, + "customer_id": "customer_id4" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/collected-data.md b/legacy/doc/models/collected-data.md new file mode 100644 index 000000000..7cda133f0 --- /dev/null +++ b/legacy/doc/models/collected-data.md @@ -0,0 +1,21 @@ + +# Collected Data + +## Structure + +`CollectedData` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `inputText` | `string \| undefined` | Optional | The buyer's input text. | + +## Example (as JSON) + +```json +{ + "input_text": "input_text8" +} +``` + diff --git a/legacy/doc/models/complete-payment-request.md b/legacy/doc/models/complete-payment-request.md new file mode 100644 index 000000000..14234ddd6 --- /dev/null +++ b/legacy/doc/models/complete-payment-request.md @@ -0,0 +1,27 @@ + +# Complete Payment Request + +Describes a request to complete (capture) a payment using +[CompletePayment](../../doc/api/payments.md#complete-payment). + +By default, payments are set to `autocomplete` immediately after they are created. +To complete payments manually, set `autocomplete` to `false`. + +## Structure + +`CompletePaymentRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `versionToken` | `string \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "version_token": "version_token8" +} +``` + diff --git a/legacy/doc/models/complete-payment-response.md b/legacy/doc/models/complete-payment-response.md new file mode 100644 index 000000000..13962cbf3 --- /dev/null +++ b/legacy/doc/models/complete-payment-response.md @@ -0,0 +1,107 @@ + +# Complete Payment Response + +Defines the response returned by[CompletePayment](../../doc/api/payments.md#complete-payment). + +## Structure + +`CompletePaymentResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | +| `payment` | [`Payment \| undefined`](../../doc/models/payment.md) | Optional | Represents a payment processed by the Square API. | + +## Example (as JSON) + +```json +{ + "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", + "tip_money": { + "amount": 190, + "currency": "TWD" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/component-component-type.md b/legacy/doc/models/component-component-type.md new file mode 100644 index 000000000..3619b08ea --- /dev/null +++ b/legacy/doc/models/component-component-type.md @@ -0,0 +1,20 @@ + +# Component Component Type + +An enum for ComponentType. + +## Enumeration + +`ComponentComponentType` + +## Fields + +| Name | +| --- | +| `APPLICATION` | +| `CARD_READER` | +| `BATTERY` | +| `WIFI` | +| `ETHERNET` | +| `PRINTER` | + diff --git a/legacy/doc/models/component.md b/legacy/doc/models/component.md new file mode 100644 index 000000000..feabdb13b --- /dev/null +++ b/legacy/doc/models/component.md @@ -0,0 +1,54 @@ + +# Component + +The wrapper object for the component entries of a given component type. + +## Structure + +`Component` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `type` | [`string`](../../doc/models/component-component-type.md) | Required | An enum for ComponentType. | +| `applicationDetails` | [`DeviceComponentDetailsApplicationDetails \| undefined`](../../doc/models/device-component-details-application-details.md) | Optional | - | +| `cardReaderDetails` | [`DeviceComponentDetailsCardReaderDetails \| undefined`](../../doc/models/device-component-details-card-reader-details.md) | Optional | - | +| `batteryDetails` | [`DeviceComponentDetailsBatteryDetails \| undefined`](../../doc/models/device-component-details-battery-details.md) | Optional | - | +| `wifiDetails` | [`DeviceComponentDetailsWiFiDetails \| undefined`](../../doc/models/device-component-details-wi-fi-details.md) | Optional | - | +| `ethernetDetails` | [`DeviceComponentDetailsEthernetDetails \| undefined`](../../doc/models/device-component-details-ethernet-details.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "type": "BATTERY", + "application_details": { + "application_type": "TERMINAL_API", + "version": "version4", + "session_location": "session_location0", + "device_code_id": "device_code_id2" + }, + "card_reader_details": { + "version": "version0" + }, + "battery_details": { + "visible_percent": 108, + "external_power": "AVAILABLE_CHARGING" + }, + "wifi_details": { + "active": false, + "ssid": "ssid8", + "ip_address_v4": "ip_address_v42", + "secure_connection": "secure_connection8", + "signal_strength": { + "value": 222 + } + }, + "ethernet_details": { + "active": false, + "ip_address_v4": "ip_address_v42" + } +} +``` + diff --git a/legacy/doc/models/confirmation-decision.md b/legacy/doc/models/confirmation-decision.md new file mode 100644 index 000000000..357eb84f8 --- /dev/null +++ b/legacy/doc/models/confirmation-decision.md @@ -0,0 +1,21 @@ + +# Confirmation Decision + +## Structure + +`ConfirmationDecision` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `hasAgreed` | `boolean \| undefined` | Optional | The buyer's decision to the displayed terms. | + +## Example (as JSON) + +```json +{ + "has_agreed": false +} +``` + diff --git a/legacy/doc/models/confirmation-options.md b/legacy/doc/models/confirmation-options.md new file mode 100644 index 000000000..8553d3193 --- /dev/null +++ b/legacy/doc/models/confirmation-options.md @@ -0,0 +1,31 @@ + +# Confirmation Options + +## Structure + +`ConfirmationOptions` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `title` | `string` | Required | The title text to display in the confirmation screen flow on the Terminal.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `250` | +| `body` | `string` | Required | The agreement details to display in the confirmation flow on the Terminal.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `10000` | +| `agreeButtonText` | `string` | Required | The button text to display indicating the customer agrees to the displayed terms.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `250` | +| `disagreeButtonText` | `string \| null \| undefined` | Optional | The button text to display indicating the customer does not agree to the displayed terms.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `250` | +| `decision` | [`ConfirmationDecision \| undefined`](../../doc/models/confirmation-decision.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "title": "title0", + "body": "body0", + "agree_button_text": "agree_button_text8", + "disagree_button_text": "disagree_button_text8", + "decision": { + "has_agreed": false + } +} +``` + diff --git a/legacy/doc/models/coordinates.md b/legacy/doc/models/coordinates.md new file mode 100644 index 000000000..a0691f385 --- /dev/null +++ b/legacy/doc/models/coordinates.md @@ -0,0 +1,25 @@ + +# Coordinates + +Latitude and longitude coordinates. + +## Structure + +`Coordinates` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `latitude` | `number \| null \| undefined` | Optional | The latitude of the coordinate expressed in degrees. | +| `longitude` | `number \| null \| undefined` | Optional | The longitude of the coordinate expressed in degrees. | + +## Example (as JSON) + +```json +{ + "latitude": 200.94, + "longitude": 52.86 +} +``` + diff --git a/legacy/doc/models/country.md b/legacy/doc/models/country.md new file mode 100644 index 000000000..39422596f --- /dev/null +++ b/legacy/doc/models/country.md @@ -0,0 +1,265 @@ + +# Country + +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). + +## Enumeration + +`Country` + +## Fields + +| Name | Description | +| --- | --- | +| `ZZ` | Unknown | +| `AD` | Andorra | +| `AE` | United Arab Emirates | +| `AF` | Afghanistan | +| `AG` | Antigua and Barbuda | +| `AI` | Anguilla | +| `AL` | Albania | +| `AM` | Armenia | +| `AO` | Angola | +| `AQ` | Antartica | +| `AR` | Argentina | +| `AS` | American Samoa | +| `AT` | Austria | +| `AU` | Australia | +| `AW` | Aruba | +| `AX` | Åland Islands | +| `AZ` | Azerbaijan | +| `BA` | Bosnia and Herzegovina | +| `BB` | Barbados | +| `BD` | Bangladesh | +| `BE` | Belgium | +| `BF` | Burkina Faso | +| `BG` | Bulgaria | +| `BH` | Bahrain | +| `BI` | Burundi | +| `BJ` | Benin | +| `BL` | Saint Barthélemy | +| `BM` | Bermuda | +| `BN` | Brunei | +| `BO` | Bolivia | +| `BQ` | Bonaire | +| `BR` | Brazil | +| `BS` | Bahamas | +| `BT` | Bhutan | +| `BV` | Bouvet Island | +| `BW` | Botswana | +| `BY` | Belarus | +| `BZ` | Belize | +| `CA` | Canada | +| `CC` | Cocos Islands | +| `CD` | Democratic Republic of the Congo | +| `CF` | Central African Republic | +| `CG` | Congo | +| `CH` | Switzerland | +| `CI` | Ivory Coast | +| `CK` | Cook Islands | +| `CL` | Chile | +| `CM` | Cameroon | +| `CN` | China | +| `CO` | Colombia | +| `CR` | Costa Rica | +| `CU` | Cuba | +| `CV` | Cabo Verde | +| `CW` | Curaçao | +| `CX` | Christmas Island | +| `CY` | Cyprus | +| `CZ` | Czechia | +| `DE` | Germany | +| `DJ` | Djibouti | +| `DK` | Denmark | +| `DM` | Dominica | +| `DO` | Dominican Republic | +| `DZ` | Algeria | +| `EC` | Ecuador | +| `EE` | Estonia | +| `EG` | Egypt | +| `EH` | Western Sahara | +| `ER` | Eritrea | +| `ES` | Spain | +| `ET` | Ethiopia | +| `FI` | Finland | +| `FJ` | Fiji | +| `FK` | Falkland Islands | +| `FM` | Federated States of Micronesia | +| `FO` | Faroe Islands | +| `FR` | France | +| `GA` | Gabon | +| `GB` | United Kingdom | +| `GD` | Grenada | +| `GE` | Georgia | +| `GF` | French Guiana | +| `GG` | Guernsey | +| `GH` | Ghana | +| `GI` | Gibraltar | +| `GL` | Greenland | +| `GM` | Gambia | +| `GN` | Guinea | +| `GP` | Guadeloupe | +| `GQ` | Equatorial Guinea | +| `GR` | Greece | +| `GS` | South Georgia and the South Sandwich Islands | +| `GT` | Guatemala | +| `GU` | Guam | +| `GW` | Guinea-Bissau | +| `GY` | Guyana | +| `HK` | Hong Kong | +| `HM` | Heard Island and McDonald Islands | +| `HN` | Honduras | +| `HR` | Croatia | +| `HT` | Haiti | +| `HU` | Hungary | +| `ID` | Indonesia | +| `IE` | Ireland | +| `IL` | Israel | +| `IM` | Isle of Man | +| `IN` | India | +| `IO` | British Indian Ocean Territory | +| `IQ` | Iraq | +| `IR` | Iran | +| `IS` | Iceland | +| `IT` | Italy | +| `JE` | Jersey | +| `JM` | Jamaica | +| `JO` | Jordan | +| `JP` | Japan | +| `KE` | Kenya | +| `KG` | Kyrgyzstan | +| `KH` | Cambodia | +| `KI` | Kiribati | +| `KM` | Comoros | +| `KN` | Saint Kitts and Nevis | +| `KP` | Democratic People's Republic of Korea | +| `KR` | Republic of Korea | +| `KW` | Kuwait | +| `KY` | Cayman Islands | +| `KZ` | Kazakhstan | +| `LA` | Lao People's Democratic Republic | +| `LB` | Lebanon | +| `LC` | Saint Lucia | +| `LI` | Liechtenstein | +| `LK` | Sri Lanka | +| `LR` | Liberia | +| `LS` | Lesotho | +| `LT` | Lithuania | +| `LU` | Luxembourg | +| `LV` | Latvia | +| `LY` | Libya | +| `MA` | Morocco | +| `MC` | Monaco | +| `MD` | Moldova | +| `ME` | Montenegro | +| `MF` | Saint Martin | +| `MG` | Madagascar | +| `MH` | Marshall Islands | +| `MK` | North Macedonia | +| `ML` | Mali | +| `MM` | Myanmar | +| `MN` | Mongolia | +| `MO` | Macao | +| `MP` | Northern Mariana Islands | +| `MQ` | Martinique | +| `MR` | Mauritania | +| `MS` | Montserrat | +| `MT` | Malta | +| `MU` | Mauritius | +| `MV` | Maldives | +| `MW` | Malawi | +| `MX` | Mexico | +| `MY` | Malaysia | +| `MZ` | Mozambique | +| `NA` | Namibia | +| `NC` | New Caledonia | +| `NE` | Niger | +| `NF` | Norfolk Island | +| `NG` | Nigeria | +| `NI` | Nicaragua | +| `NL` | Netherlands | +| `NO` | Norway | +| `NP` | Nepal | +| `NR` | Nauru | +| `NU` | Niue | +| `NZ` | New Zealand | +| `OM` | Oman | +| `PA` | Panama | +| `PE` | Peru | +| `PF` | French Polynesia | +| `PG` | Papua New Guinea | +| `PH` | Philippines | +| `PK` | Pakistan | +| `PL` | Poland | +| `PM` | Saint Pierre and Miquelon | +| `PN` | Pitcairn | +| `PR` | Puerto Rico | +| `PS` | Palestine | +| `PT` | Portugal | +| `PW` | Palau | +| `PY` | Paraguay | +| `QA` | Qatar | +| `RE` | Réunion | +| `RO` | Romania | +| `RS` | Serbia | +| `RU` | Russia | +| `RW` | Rwanda | +| `SA` | Saudi Arabia | +| `SB` | Solomon Islands | +| `SC` | Seychelles | +| `SD` | Sudan | +| `SE` | Sweden | +| `SG` | Singapore | +| `SH` | Saint Helena, Ascension and Tristan da Cunha | +| `SI` | Slovenia | +| `SJ` | Svalbard and Jan Mayen | +| `SK` | Slovakia | +| `SL` | Sierra Leone | +| `SM` | San Marino | +| `SN` | Senegal | +| `SO` | Somalia | +| `SR` | Suriname | +| `SS` | South Sudan | +| `ST` | Sao Tome and Principe | +| `SV` | El Salvador | +| `SX` | Sint Maarten | +| `SY` | Syrian Arab Republic | +| `SZ` | Eswatini | +| `TC` | Turks and Caicos Islands | +| `TD` | Chad | +| `TF` | French Southern Territories | +| `TG` | Togo | +| `TH` | Thailand | +| `TJ` | Tajikistan | +| `TK` | Tokelau | +| `TL` | Timor-Leste | +| `TM` | Turkmenistan | +| `TN` | Tunisia | +| `TO` | Tonga | +| `TR` | Turkey | +| `TT` | Trinidad and Tobago | +| `TV` | Tuvalu | +| `TW` | Taiwan | +| `TZ` | Tanzania | +| `UA` | Ukraine | +| `UG` | Uganda | +| `UM` | United States Minor Outlying Islands | +| `US` | United States of America | +| `UY` | Uruguay | +| `UZ` | Uzbekistan | +| `VA` | Vatican City | +| `VC` | Saint Vincent and the Grenadines | +| `VE` | Venezuela | +| `VG` | British Virgin Islands | +| `VI` | U.S. Virgin Islands | +| `VN` | Vietnam | +| `VU` | Vanuatu | +| `WF` | Wallis and Futuna | +| `WS` | Samoa | +| `YE` | Yemen | +| `YT` | Mayotte | +| `ZA` | South Africa | +| `ZM` | Zambia | +| `ZW` | Zimbabwe | + diff --git a/legacy/doc/models/create-booking-custom-attribute-definition-request.md b/legacy/doc/models/create-booking-custom-attribute-definition-request.md new file mode 100644 index 000000000..9d791c6a5 --- /dev/null +++ b/legacy/doc/models/create-booking-custom-attribute-definition-request.md @@ -0,0 +1,34 @@ + +# Create Booking Custom Attribute Definition Request + +Represents a [CreateBookingCustomAttributeDefinition](../../doc/api/booking-custom-attributes.md#create-booking-custom-attribute-definition) request. + +## Structure + +`CreateBookingCustomAttributeDefinitionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttributeDefinition` | [`CustomAttributeDefinition`](../../doc/models/custom-attribute-definition.md) | Required | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | +| `idempotencyKey` | `string \| undefined` | Optional | 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).
**Constraints**: *Maximum Length*: `45` | + +## Example (as JSON) + +```json +{ + "custom_attribute_definition": { + "key": "key2", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name2", + "description": "description8", + "visibility": "VISIBILITY_HIDDEN" + }, + "idempotency_key": "idempotency_key6" +} +``` + diff --git a/legacy/doc/models/create-booking-custom-attribute-definition-response.md b/legacy/doc/models/create-booking-custom-attribute-definition-response.md new file mode 100644 index 000000000..5dcc36523 --- /dev/null +++ b/legacy/doc/models/create-booking-custom-attribute-definition-response.md @@ -0,0 +1,38 @@ + +# Create Booking Custom Attribute Definition Response + +Represents a [CreateBookingCustomAttributeDefinition](../../doc/api/booking-custom-attributes.md#create-booking-custom-attribute-definition) response. +Either `custom_attribute_definition` or `errors` is present in the response. + +## Structure + +`CreateBookingCustomAttributeDefinitionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttributeDefinition` | [`CustomAttributeDefinition \| undefined`](../../doc/models/custom-attribute-definition.md) | Optional | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "custom_attribute_definition": { + "created_at": "2022-11-16T15:27:30Z", + "description": "The favorite shampoo of the customer.", + "key": "favoriteShampoo", + "name": "Favorite Shampoo", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "updated_at": "2022-11-16T15:27:30Z", + "version": 1, + "visibility": "VISIBILITY_HIDDEN" + }, + "errors": [] +} +``` + diff --git a/legacy/doc/models/create-booking-request.md b/legacy/doc/models/create-booking-request.md new file mode 100644 index 000000000..1eb1778ed --- /dev/null +++ b/legacy/doc/models/create-booking-request.md @@ -0,0 +1,29 @@ + +# Create Booking Request + +## Structure + +`CreateBookingRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string \| undefined` | Optional | A unique key to make this request an idempotent operation.
**Constraints**: *Maximum Length*: `255` | +| `booking` | [`Booking`](../../doc/models/booking.md) | Required | 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. | + +## Example (as JSON) + +```json +{ + "idempotency_key": "idempotency_key4", + "booking": { + "id": "id4", + "version": 156, + "status": "CANCELLED_BY_SELLER", + "created_at": "created_at2", + "updated_at": "updated_at0" + } +} +``` + diff --git a/legacy/doc/models/create-booking-response.md b/legacy/doc/models/create-booking-response.md new file mode 100644 index 000000000..8c1d3ee9c --- /dev/null +++ b/legacy/doc/models/create-booking-response.md @@ -0,0 +1,42 @@ + +# Create Booking Response + +## Structure + +`CreateBookingResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `booking` | [`Booking \| undefined`](../../doc/models/booking.md) | Optional | 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. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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": [] +} +``` + diff --git a/legacy/doc/models/create-break-type-request.md b/legacy/doc/models/create-break-type-request.md new file mode 100644 index 000000000..f152e74ef --- /dev/null +++ b/legacy/doc/models/create-break-type-request.md @@ -0,0 +1,34 @@ + +# Create Break Type Request + +A request to create a new `BreakType`. + +## Structure + +`CreateBreakTypeRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string \| undefined` | Optional | A unique string value to ensure the idempotency of the operation.
**Constraints**: *Maximum Length*: `128` | +| `breakType` | [`BreakType`](../../doc/models/break-type.md) | Required | A defined break template that sets an expectation for possible `Break`
instances on a `Shift`. | + +## Example (as JSON) + +```json +{ + "break_type": { + "break_name": "Lunch Break", + "expected_duration": "PT30M", + "is_paid": true, + "location_id": "CGJN03P1D08GF", + "id": "id8", + "version": 132, + "created_at": "created_at6", + "updated_at": "updated_at4" + }, + "idempotency_key": "PAD3NG5KSN2GL" +} +``` + diff --git a/legacy/doc/models/create-break-type-response.md b/legacy/doc/models/create-break-type-response.md new file mode 100644 index 000000000..d533f2773 --- /dev/null +++ b/legacy/doc/models/create-break-type-response.md @@ -0,0 +1,55 @@ + +# Create Break Type Response + +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. + +## Structure + +`CreateBreakTypeResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `breakType` | [`BreakType \| undefined`](../../doc/models/break-type.md) | Optional | A defined break template that sets an expectation for possible `Break`
instances on a `Shift`. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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 + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/create-card-request.md b/legacy/doc/models/create-card-request.md new file mode 100644 index 000000000..c806aef5b --- /dev/null +++ b/legacy/doc/models/create-card-request.md @@ -0,0 +1,47 @@ + +# Create Card Request + +Creates a card from the source (payment token or payment id). Accessible via +HTTP requests at POST https://connect.squareup.com/v2/cards + +## Structure + +`CreateCardRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string` | Required | 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.
**Constraints**: *Minimum Length*: `1` | +| `sourceId` | `string` | Required | The ID of the source which represents the card information to be stored. This can be a card nonce or a payment id.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `16384` | +| `verificationToken` | `string \| undefined` | Optional | 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` | [`Card`](../../doc/models/card.md) | Required | 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. | + +## Example (as JSON) + +```json +{ + "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", + "id": "id6", + "card_brand": "OTHER_BRAND", + "last_4": "last_48", + "exp_month": 228, + "exp_year": 68 + }, + "idempotency_key": "4935a656-a929-4792-b97c-8848be85c27c", + "source_id": "cnon:uIbfJXhXETSP197M3GB", + "verification_token": "verification_token4" +} +``` + diff --git a/legacy/doc/models/create-card-response.md b/legacy/doc/models/create-card-response.md new file mode 100644 index 000000000..343fabd19 --- /dev/null +++ b/legacy/doc/models/create-card-response.md @@ -0,0 +1,72 @@ + +# Create Card Response + +Defines the fields that are included in the response body of +a request to the [CreateCard](../../doc/api/cards.md#create-card) endpoint. + +Note: if there are errors processing the request, the card field will not be +present. + +## Structure + +`CreateCardResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Errors resulting from the request. | +| `card` | [`Card \| undefined`](../../doc/models/card.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "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", + "id": "ccof:uIbfJXhXETSP197M3GB", + "last_4": "1111", + "merchant_id": "6SSW7HV8K2ST5", + "prepaid_type": "NOT_PREPAID", + "reference_id": "user-id-1", + "version": 1 + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/create-catalog-image-request.md b/legacy/doc/models/create-catalog-image-request.md new file mode 100644 index 000000000..07b1ed2bb --- /dev/null +++ b/legacy/doc/models/create-catalog-image-request.md @@ -0,0 +1,66 @@ + +# Create Catalog Image Request + +## Structure + +`CreateCatalogImageRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string` | Required | 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.
**Constraints**: *Minimum Length*: `1` | +| `objectId` | `string \| undefined` | Optional | 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` | [`CatalogObject`](../../doc/models/catalog-object.md) | Required | 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. | +| `isPrimary` | `boolean \| undefined` | Optional | 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`. | + +## Example (as JSON) + +```json +{ + "idempotency_key": "528dea59-7bfb-43c1-bd48-4a6bba7dd61f86", + "image": { + "id": "#TEMP_ID", + "image_data": { + "caption": "A picture of a cup of coffee" + }, + "type": "IMAGE", + "updated_at": "updated_at2", + "version": 100, + "is_deleted": false, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] + }, + "object_id": "ND6EA5AAJEO5WL3JNNIAQA32", + "is_primary": false +} +``` + diff --git a/legacy/doc/models/create-catalog-image-response.md b/legacy/doc/models/create-catalog-image-response.md new file mode 100644 index 000000000..31b9abcb6 --- /dev/null +++ b/legacy/doc/models/create-catalog-image-response.md @@ -0,0 +1,70 @@ + +# Create Catalog Image Response + +## Structure + +`CreateCatalogImageResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `image` | [`CatalogObject \| undefined`](../../doc/models/catalog-object.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "image": { + "id": "KQLFFHA6K6J3YQAQAWDQAL57", + "image_data": { + "caption": "A picture of a cup of coffee", + "url": "https://..." + }, + "type": "IMAGE", + "updated_at": "updated_at2", + "version": 100, + "is_deleted": false, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/create-checkout-request.md b/legacy/doc/models/create-checkout-request.md new file mode 100644 index 000000000..2c7c74fe7 --- /dev/null +++ b/legacy/doc/models/create-checkout-request.md @@ -0,0 +1,179 @@ + +# Create Checkout Request + +Defines the parameters that can be included in the body of +a request to the `CreateCheckout` endpoint. + +## Structure + +`CreateCheckoutRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string` | Required | 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).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `192` | +| `order` | [`CreateOrderRequest`](../../doc/models/create-order-request.md) | Required | - | +| `askForShippingAddress` | `boolean \| undefined` | Optional | 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`. | +| `merchantSupportEmail` | `string \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `254` | +| `prePopulateBuyerEmail` | `string \| undefined` | Optional | If provided, the buyer's email is prepopulated on the checkout page
as an editable text field.

Default: none; only exists if explicitly set.
**Constraints**: *Maximum Length*: `254` | +| `prePopulateShippingAddress` | [`Address \| undefined`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | +| `redirectUrl` | `string \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `800` | +| `additionalRecipients` | [`ChargeRequestAdditionalRecipient[] \| undefined`](../../doc/models/charge-request-additional-recipient.md) | Optional | 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` | `string \| undefined` | Optional | An optional note to associate with the `checkout` object.

This value cannot exceed 60 characters.
**Constraints**: *Maximum Length*: `60` | + +## Example (as JSON) + +```json +{ + "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", + "uid": "uid8", + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note4", + "catalog_object_id": "catalog_object_id2" + }, + { + "base_price_money": { + "amount": 2500, + "currency": "USD" + }, + "name": "Slim Jeans", + "quantity": "1", + "uid": "uid8", + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note4", + "catalog_object_id": "catalog_object_id2" + }, + { + "base_price_money": { + "amount": 3500, + "currency": "USD" + }, + "name": "Woven Sweater", + "quantity": "3", + "uid": "uid8", + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note4", + "catalog_object_id": "catalog_object_id2" + } + ], + "location_id": "location_id", + "reference_id": "reference_id", + "taxes": [ + { + "percentage": "7.75", + "scope": "LINE_ITEM", + "type": "INCLUSIVE", + "uid": "38ze1696-z1e3-5628-af6d-f1e04d947fg3" + } + ], + "id": "id6", + "source": { + "name": "name4" + } + } + }, + "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", + "address_line_3": "address_line_32", + "sublocality": "sublocality6" + }, + "redirect_url": "https://merchant.website.com/order-confirm" +} +``` + diff --git a/legacy/doc/models/create-checkout-response.md b/legacy/doc/models/create-checkout-response.md new file mode 100644 index 000000000..2a13ffae5 --- /dev/null +++ b/legacy/doc/models/create-checkout-response.md @@ -0,0 +1,172 @@ + +# Create Checkout Response + +Defines the fields that are included in the response body of +a request to the `CreateCheckout` endpoint. + +## Structure + +`CreateCheckoutResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `checkout` | [`Checkout \| undefined`](../../doc/models/checkout.md) | Optional | Square Checkout lets merchants accept online payments for supported
payment types using a checkout workflow hosted on squareup.com. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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&l=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 + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/create-customer-card-request.md b/legacy/doc/models/create-customer-card-request.md new file mode 100644 index 000000000..4790c2af3 --- /dev/null +++ b/legacy/doc/models/create-customer-card-request.md @@ -0,0 +1,39 @@ + +# Create Customer Card Request + +Defines the fields that are included in the request body of a request +to the `CreateCustomerCard` endpoint. + +## Structure + +`CreateCustomerCardRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `cardNonce` | `string` | Required | 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. | +| `billingAddress` | [`Address \| undefined`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | +| `cardholderName` | `string \| undefined` | Optional | The full name printed on the credit card. | +| `verificationToken` | `string \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "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", + "address_line_3": "address_line_34", + "sublocality": "sublocality8" + }, + "card_nonce": "YOUR_CARD_NONCE", + "cardholder_name": "Amelia Earhart", + "verification_token": "verification_token0" +} +``` + diff --git a/legacy/doc/models/create-customer-card-response.md b/legacy/doc/models/create-customer-card-response.md new file mode 100644 index 000000000..f5bfc9d1e --- /dev/null +++ b/legacy/doc/models/create-customer-card-response.md @@ -0,0 +1,56 @@ + +# Create Customer Card Response + +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). + +## Structure + +`CreateCustomerCardResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `card` | [`Card \| undefined`](../../doc/models/card.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "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" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/create-customer-custom-attribute-definition-request.md b/legacy/doc/models/create-customer-custom-attribute-definition-request.md new file mode 100644 index 000000000..73aaa8c7a --- /dev/null +++ b/legacy/doc/models/create-customer-custom-attribute-definition-request.md @@ -0,0 +1,34 @@ + +# Create Customer Custom Attribute Definition Request + +Represents a [CreateCustomerCustomAttributeDefinition](../../doc/api/customer-custom-attributes.md#create-customer-custom-attribute-definition) request. + +## Structure + +`CreateCustomerCustomAttributeDefinitionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttributeDefinition` | [`CustomAttributeDefinition`](../../doc/models/custom-attribute-definition.md) | Required | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | +| `idempotencyKey` | `string \| undefined` | Optional | 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).
**Constraints**: *Maximum Length*: `45` | + +## Example (as JSON) + +```json +{ + "custom_attribute_definition": { + "description": "The favorite movie of the customer.", + "key": "favoritemovie", + "name": "Favorite Movie", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "visibility": "VISIBILITY_HIDDEN" + }, + "idempotency_key": "idempotency_key4" +} +``` + diff --git a/legacy/doc/models/create-customer-custom-attribute-definition-response.md b/legacy/doc/models/create-customer-custom-attribute-definition-response.md new file mode 100644 index 000000000..706a1b760 --- /dev/null +++ b/legacy/doc/models/create-customer-custom-attribute-definition-response.md @@ -0,0 +1,57 @@ + +# Create Customer Custom Attribute Definition Response + +Represents a [CreateCustomerCustomAttributeDefinition](../../doc/api/customer-custom-attributes.md#create-customer-custom-attribute-definition) response. +Either `custom_attribute_definition` or `errors` is present in the response. + +## Structure + +`CreateCustomerCustomAttributeDefinitionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttributeDefinition` | [`CustomAttributeDefinition \| undefined`](../../doc/models/custom-attribute-definition.md) | Optional | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "custom_attribute_definition": { + "created_at": "2022-04-26T15:27:30Z", + "description": "The favorite movie of the customer.", + "key": "favoritemovie", + "name": "Favorite Movie", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "updated_at": "2022-04-26T15:27:30Z", + "version": 1, + "visibility": "VISIBILITY_HIDDEN" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/create-customer-group-request.md b/legacy/doc/models/create-customer-group-request.md new file mode 100644 index 000000000..5eda7d66b --- /dev/null +++ b/legacy/doc/models/create-customer-group-request.md @@ -0,0 +1,31 @@ + +# Create Customer Group Request + +Defines the body parameters that can be included in a request to the +[CreateCustomerGroup](../../doc/api/customer-groups.md#create-customer-group) endpoint. + +## Structure + +`CreateCustomerGroupRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string \| undefined` | Optional | The idempotency key for the request. For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). | +| `group` | [`CustomerGroup`](../../doc/models/customer-group.md) | Required | 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. | + +## Example (as JSON) + +```json +{ + "group": { + "name": "Loyal Customers", + "id": "id8", + "created_at": "created_at4", + "updated_at": "updated_at6" + }, + "idempotency_key": "idempotency_key0" +} +``` + diff --git a/legacy/doc/models/create-customer-group-response.md b/legacy/doc/models/create-customer-group-response.md new file mode 100644 index 000000000..9739506e0 --- /dev/null +++ b/legacy/doc/models/create-customer-group-response.md @@ -0,0 +1,40 @@ + +# Create Customer Group Response + +Defines the fields that are included in the response body of +a request to the [CreateCustomerGroup](../../doc/api/customer-groups.md#create-customer-group) endpoint. + +Either `errors` or `group` is present in a given response (never both). + +## Structure + +`CreateCustomerGroupResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `group` | [`CustomerGroup \| undefined`](../../doc/models/customer-group.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "group": { + "created_at": "2020-04-13T21:54:57.863Z", + "id": "2TAT3CMH4Q0A9M87XJZED0WMR3", + "name": "Loyal Customers", + "updated_at": "2020-04-13T21:54:58Z" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/create-customer-request.md b/legacy/doc/models/create-customer-request.md new file mode 100644 index 000000000..8ca467771 --- /dev/null +++ b/legacy/doc/models/create-customer-request.md @@ -0,0 +1,51 @@ + +# Create Customer Request + +Defines the body parameters that can be included in a request to the +`CreateCustomer` endpoint. + +## Structure + +`CreateCustomerRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string \| undefined` | Optional | The idempotency key for the request. For more information, see
[Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency). | +| `givenName` | `string \| undefined` | Optional | The given name (that is, the first name) associated with the customer profile.

The maximum length for this value is 300 characters. | +| `familyName` | `string \| undefined` | Optional | The family name (that is, the last name) associated with the customer profile.

The maximum length for this value is 300 characters. | +| `companyName` | `string \| undefined` | Optional | A business name associated with the customer profile.

The maximum length for this value is 500 characters. | +| `nickname` | `string \| undefined` | Optional | A nickname for the customer profile.

The maximum length for this value is 100 characters. | +| `emailAddress` | `string \| undefined` | Optional | The email address associated with the customer profile.

The maximum length for this value is 254 characters. | +| `address` | [`Address \| undefined`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | +| `phoneNumber` | `string \| undefined` | Optional | 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). | +| `referenceId` | `string \| undefined` | Optional | 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` | `string \| undefined` | Optional | A custom note associated with the customer profile. | +| `birthday` | `string \| undefined` | Optional | 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. | +| `taxIds` | [`CustomerTaxIds \| undefined`](../../doc/models/customer-tax-ids.md) | Optional | Represents the tax ID associated with a [customer profile](../../doc/models/customer.md). 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). | + +## Example (as JSON) + +```json +{ + "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", + "idempotency_key": "idempotency_key4", + "company_name": "company_name4", + "nickname": "nickname4" +} +``` + diff --git a/legacy/doc/models/create-customer-response.md b/legacy/doc/models/create-customer-response.md new file mode 100644 index 000000000..e2127068c --- /dev/null +++ b/legacy/doc/models/create-customer-response.md @@ -0,0 +1,68 @@ + +# Create Customer Response + +Defines the fields that are included in the response body of +a request to the [CreateCustomer](../../doc/api/customers.md#create-customer) or +[BulkCreateCustomers](../../doc/api/customers.md#bulk-create-customers) endpoint. + +Either `errors` or `customer` is present in a given response (never both). + +## Structure + +`CreateCustomerResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `customer` | [`Customer \| undefined`](../../doc/models/customer.md) | Optional | Represents a Square customer profile in the Customer Directory of a Square seller. | + +## Example (as JSON) + +```json +{ + "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, + "cards": [ + { + "id": "id8", + "card_brand": "DISCOVER", + "last_4": "last_40", + "exp_month": 152, + "exp_year": 144 + } + ] + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/create-device-code-request.md b/legacy/doc/models/create-device-code-request.md new file mode 100644 index 000000000..af7ce9244 --- /dev/null +++ b/legacy/doc/models/create-device-code-request.md @@ -0,0 +1,30 @@ + +# Create Device Code Request + +## Structure + +`CreateDeviceCodeRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string` | Required | 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.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128` | +| `deviceCode` | [`DeviceCode`](../../doc/models/device-code.md) | Required | - | + +## Example (as JSON) + +```json +{ + "device_code": { + "location_id": "B5E4484SHHNYH", + "name": "Counter 1", + "product_type": "TERMINAL_API", + "id": "id4", + "code": "code2", + "device_id": "device_id0" + }, + "idempotency_key": "01bb00a6-0c86-4770-94ed-f5fca973cd56" +} +``` + diff --git a/legacy/doc/models/create-device-code-response.md b/legacy/doc/models/create-device-code-response.md new file mode 100644 index 000000000..cf4425137 --- /dev/null +++ b/legacy/doc/models/create-device-code-response.md @@ -0,0 +1,41 @@ + +# Create Device Code Response + +## Structure + +`CreateDeviceCodeResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `deviceCode` | [`DeviceCode \| undefined`](../../doc/models/device-code.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "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", + "device_id": "device_id0" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/create-dispute-evidence-file-request.md b/legacy/doc/models/create-dispute-evidence-file-request.md new file mode 100644 index 000000000..6af5fb252 --- /dev/null +++ b/legacy/doc/models/create-dispute-evidence-file-request.md @@ -0,0 +1,27 @@ + +# Create Dispute Evidence File Request + +Defines the parameters for a `CreateDisputeEvidenceFile` request. + +## Structure + +`CreateDisputeEvidenceFileRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string` | Required | A unique key identifying the request. For more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `45` | +| `evidenceType` | [`string \| undefined`](../../doc/models/dispute-evidence-type.md) | Optional | The type of the dispute evidence. | +| `contentType` | `string \| undefined` | Optional | The MIME type of the uploaded file.
The type can be image/heic, image/heif, image/jpeg, application/pdf, image/png, or image/tiff.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | + +## Example (as JSON) + +```json +{ + "idempotency_key": "idempotency_key8", + "evidence_type": "REBUTTAL_EXPLANATION", + "content_type": "content_type6" +} +``` + diff --git a/legacy/doc/models/create-dispute-evidence-file-response.md b/legacy/doc/models/create-dispute-evidence-file-response.md new file mode 100644 index 000000000..fa449586d --- /dev/null +++ b/legacy/doc/models/create-dispute-evidence-file-response.md @@ -0,0 +1,48 @@ + +# Create Dispute Evidence File Response + +Defines the fields in a `CreateDisputeEvidenceFile` response. + +## Structure + +`CreateDisputeEvidenceFileResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `evidence` | [`DisputeEvidence \| undefined`](../../doc/models/dispute-evidence.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "evidence": { + "dispute_id": "bVTprrwk0gygTLZ96VX1oB", + "evidence_file": { + "filename": "customer-interaction.jpg", + "filetype": "image/jpeg" + }, + "id": "TOomLInj6iWmP3N8qfCXrB", + "uploaded_at": "2022-05-18T16:01:10.000Z", + "evidence_id": "evidence_id0", + "evidence_text": "evidence_text6" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/create-dispute-evidence-text-request.md b/legacy/doc/models/create-dispute-evidence-text-request.md new file mode 100644 index 000000000..e6c8823e3 --- /dev/null +++ b/legacy/doc/models/create-dispute-evidence-text-request.md @@ -0,0 +1,27 @@ + +# Create Dispute Evidence Text Request + +Defines the parameters for a `CreateDisputeEvidenceText` request. + +## Structure + +`CreateDisputeEvidenceTextRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string` | Required | A unique key identifying the request. For more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `45` | +| `evidenceType` | [`string \| undefined`](../../doc/models/dispute-evidence-type.md) | Optional | The type of the dispute evidence. | +| `evidenceText` | `string` | Required | The evidence string.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `500` | + +## Example (as JSON) + +```json +{ + "evidence_text": "1Z8888888888888888", + "evidence_type": "TRACKING_NUMBER", + "idempotency_key": "ed3ee3933d946f1514d505d173c82648" +} +``` + diff --git a/legacy/doc/models/create-dispute-evidence-text-response.md b/legacy/doc/models/create-dispute-evidence-text-response.md new file mode 100644 index 000000000..4ec3193c9 --- /dev/null +++ b/legacy/doc/models/create-dispute-evidence-text-response.md @@ -0,0 +1,49 @@ + +# Create Dispute Evidence Text Response + +Defines the fields in a `CreateDisputeEvidenceText` response. + +## Structure + +`CreateDisputeEvidenceTextResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `evidence` | [`DisputeEvidence \| undefined`](../../doc/models/dispute-evidence.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "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", + "evidence_id": "evidence_id0", + "evidence_file": { + "filename": "filename8", + "filetype": "filetype8" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/create-gift-card-activity-request.md b/legacy/doc/models/create-gift-card-activity-request.md new file mode 100644 index 000000000..f85bcc57b --- /dev/null +++ b/legacy/doc/models/create-gift-card-activity-request.md @@ -0,0 +1,40 @@ + +# Create Gift Card Activity Request + +A request to create a gift card activity. + +## Structure + +`CreateGiftCardActivityRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string` | Required | A unique string that identifies the `CreateGiftCardActivity` request.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128` | +| `giftCardActivity` | [`GiftCardActivity`](../../doc/models/gift-card-activity.md) | Required | Represents an action performed on a [gift card](../../doc/models/gift-card.md) 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. | + +## Example (as JSON) + +```json +{ + "gift_card_activity": { + "activate_activity_details": { + "line_item_uid": "eIWl7X0nMuO9Ewbh0ChIx", + "order_id": "jJNGHm4gLI6XkFbwtiSLqK72KkAZY" + }, + "gift_card_id": "gftc:6d55a72470d940c6ba09c0ab8ad08d20", + "location_id": "81FN9BNFZTKS4", + "type": "ACTIVATE", + "id": "id6", + "created_at": "created_at6", + "gift_card_gan": "gift_card_gan2", + "gift_card_balance_money": { + "amount": 82, + "currency": "IRR" + } + }, + "idempotency_key": "U16kfr-kA70er-q4Rsym-7U7NnY" +} +``` + diff --git a/legacy/doc/models/create-gift-card-activity-response.md b/legacy/doc/models/create-gift-card-activity-response.md new file mode 100644 index 000000000..3aef9d1f7 --- /dev/null +++ b/legacy/doc/models/create-gift-card-activity-response.md @@ -0,0 +1,58 @@ + +# Create Gift Card Activity Response + +A response that contains a `GiftCardActivity` that was created. +The response might contain a set of `Error` objects if the request resulted in errors. + +## Structure + +`CreateGiftCardActivityResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `giftCardActivity` | [`GiftCardActivity \| undefined`](../../doc/models/gift-card-activity.md) | Optional | Represents an action performed on a [gift card](../../doc/models/gift-card.md) 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. | + +## Example (as JSON) + +```json +{ + "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" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/create-gift-card-request.md b/legacy/doc/models/create-gift-card-request.md new file mode 100644 index 000000000..9f5f0c774 --- /dev/null +++ b/legacy/doc/models/create-gift-card-request.md @@ -0,0 +1,37 @@ + +# Create Gift Card Request + +Represents a [CreateGiftCard](../../doc/api/gift-cards.md#create-gift-card) request. + +## Structure + +`CreateGiftCardRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string` | Required | 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).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128` | +| `locationId` | `string` | Required | 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.
**Constraints**: *Minimum Length*: `1` | +| `giftCard` | [`GiftCard`](../../doc/models/gift-card.md) | Required | Represents a Square gift card. | + +## Example (as JSON) + +```json +{ + "gift_card": { + "type": "DIGITAL", + "id": "id0", + "gan_source": "SQUARE", + "state": "ACTIVE", + "balance_money": { + "amount": 146, + "currency": "BBD" + }, + "gan": "gan6" + }, + "idempotency_key": "NC9Tm69EjbjtConu", + "location_id": "81FN9BNFZTKS4" +} +``` + diff --git a/legacy/doc/models/create-gift-card-response.md b/legacy/doc/models/create-gift-card-response.md new file mode 100644 index 000000000..919cc2042 --- /dev/null +++ b/legacy/doc/models/create-gift-card-response.md @@ -0,0 +1,56 @@ + +# Create Gift Card Response + +A response that contains a `GiftCard`. The response might contain a set of `Error` objects if the request +resulted in errors. + +## Structure + +`CreateGiftCardResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `giftCard` | [`GiftCard \| undefined`](../../doc/models/gift-card.md) | Optional | Represents a Square gift card. | + +## Example (as JSON) + +```json +{ + "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" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/create-invoice-attachment-request.md b/legacy/doc/models/create-invoice-attachment-request.md new file mode 100644 index 000000000..d3a4dbd41 --- /dev/null +++ b/legacy/doc/models/create-invoice-attachment-request.md @@ -0,0 +1,25 @@ + +# Create Invoice Attachment Request + +Represents a [CreateInvoiceAttachment](../../doc/api/invoices.md#create-invoice-attachment) request. + +## Structure + +`CreateInvoiceAttachmentRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string \| undefined` | Optional | A unique string that identifies the `CreateInvoiceAttachment` request.
For more information, see [Idempotency](https://developer.squareup.com/docs/build-basics/common-api-patterns/idempotency).
**Constraints**: *Maximum Length*: `128` | +| `description` | `string \| undefined` | Optional | The description of the attachment to display on the invoice.
**Constraints**: *Maximum Length*: `128` | + +## Example (as JSON) + +```json +{ + "description": "Service contract", + "idempotency_key": "ae5e84f9-4742-4fc1-ba12-a3ce3748f1c3" +} +``` + diff --git a/legacy/doc/models/create-invoice-attachment-response.md b/legacy/doc/models/create-invoice-attachment-response.md new file mode 100644 index 000000000..c7d0cbf56 --- /dev/null +++ b/legacy/doc/models/create-invoice-attachment-response.md @@ -0,0 +1,52 @@ + +# Create Invoice Attachment Response + +Represents a [CreateInvoiceAttachment](../../doc/api/invoices.md#create-invoice-attachment) response. + +## Structure + +`CreateInvoiceAttachmentResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `attachment` | [`InvoiceAttachment \| undefined`](../../doc/models/invoice-attachment.md) | Optional | Represents a file attached to an [invoice](../../doc/models/invoice.md). | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | + +## Example (as JSON) + +```json +{ + "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" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/create-invoice-request.md b/legacy/doc/models/create-invoice-request.md new file mode 100644 index 000000000..7f095fde6 --- /dev/null +++ b/legacy/doc/models/create-invoice-request.md @@ -0,0 +1,83 @@ + +# Create Invoice Request + +Describes a `CreateInvoice` request. + +## Structure + +`CreateInvoiceRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `invoice` | [`Invoice`](../../doc/models/invoice.md) | Required | 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). | +| `idempotencyKey` | `string \| undefined` | Optional | 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).
**Constraints**: *Maximum Length*: `128` | + +## Example (as JSON) + +```json +{ + "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", + "given_name": "given_name6", + "family_name": "family_name8", + "email_address": "email_address2", + "address": { + "address_line_1": "address_line_16", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "locality": "locality6", + "sublocality": "sublocality6" + } + }, + "sale_or_service_date": "2030-01-24", + "scheduled_at": "2030-01-13T10:00:00Z", + "store_payment_method_enabled": false, + "title": "Event Planning Services", + "id": "id6", + "version": 118 + } +} +``` + diff --git a/legacy/doc/models/create-invoice-response.md b/legacy/doc/models/create-invoice-response.md new file mode 100644 index 000000000..460c49bc7 --- /dev/null +++ b/legacy/doc/models/create-invoice-response.md @@ -0,0 +1,106 @@ + +# Create Invoice Response + +The response returned by the `CreateInvoice` request. + +## Structure + +`CreateInvoiceResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `invoice` | [`Invoice \| undefined`](../../doc/models/invoice.md) | Optional | 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). | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | + +## Example (as JSON) + +```json +{ + "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", + "address": { + "address_line_1": "address_line_16", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "locality": "locality6", + "sublocality": "sublocality6" + } + }, + "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 + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/create-job-request.md b/legacy/doc/models/create-job-request.md new file mode 100644 index 000000000..663270142 --- /dev/null +++ b/legacy/doc/models/create-job-request.md @@ -0,0 +1,31 @@ + +# Create Job Request + +Represents a [CreateJob](../../doc/api/team.md#create-job) request. + +## Structure + +`CreateJobRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `job` | [`Job`](../../doc/models/job.md) | Required | Represents a job that can be assigned to [team members](../../doc/models/team-member.md). This object defines the
job's title and tip eligibility. Compensation is defined in a [job assignment](../../doc/models/job-assignment.md)
in a team member's wage setting. | +| `idempotencyKey` | `string` | Required | 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).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `45` | + +## Example (as JSON) + +```json +{ + "idempotency_key": "idempotency-key-0", + "job": { + "is_tip_eligible": true, + "title": "Cashier", + "id": "id6", + "created_at": "created_at4", + "updated_at": "updated_at8" + } +} +``` + diff --git a/legacy/doc/models/create-job-response.md b/legacy/doc/models/create-job-response.md new file mode 100644 index 000000000..b5905dd9a --- /dev/null +++ b/legacy/doc/models/create-job-response.md @@ -0,0 +1,40 @@ + +# Create Job Response + +Represents a [CreateJob](../../doc/api/team.md#create-job) response. Either `job` or `errors` +is present in the response. + +## Structure + +`CreateJobResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `job` | [`Job \| undefined`](../../doc/models/job.md) | Optional | Represents a job that can be assigned to [team members](../../doc/models/team-member.md). This object defines the
job's title and tip eligibility. Compensation is defined in a [job assignment](../../doc/models/job-assignment.md)
in a team member's wage setting. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | The errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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 + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/create-location-custom-attribute-definition-request.md b/legacy/doc/models/create-location-custom-attribute-definition-request.md new file mode 100644 index 000000000..81c15fee4 --- /dev/null +++ b/legacy/doc/models/create-location-custom-attribute-definition-request.md @@ -0,0 +1,34 @@ + +# Create Location Custom Attribute Definition Request + +Represents a [CreateLocationCustomAttributeDefinition](../../doc/api/location-custom-attributes.md#create-location-custom-attribute-definition) request. + +## Structure + +`CreateLocationCustomAttributeDefinitionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttributeDefinition` | [`CustomAttributeDefinition`](../../doc/models/custom-attribute-definition.md) | Required | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | +| `idempotencyKey` | `string \| undefined` | Optional | 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).
**Constraints**: *Maximum Length*: `45` | + +## Example (as JSON) + +```json +{ + "custom_attribute_definition": { + "description": "Bestselling item at location", + "key": "bestseller", + "name": "Bestseller", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "idempotency_key": "idempotency_key6" +} +``` + diff --git a/legacy/doc/models/create-location-custom-attribute-definition-response.md b/legacy/doc/models/create-location-custom-attribute-definition-response.md new file mode 100644 index 000000000..73b266125 --- /dev/null +++ b/legacy/doc/models/create-location-custom-attribute-definition-response.md @@ -0,0 +1,45 @@ + +# Create Location Custom Attribute Definition Response + +Represents a [CreateLocationCustomAttributeDefinition](../../doc/api/location-custom-attributes.md#create-location-custom-attribute-definition) response. +Either `custom_attribute_definition` or `errors` is present in the response. + +## Structure + +`CreateLocationCustomAttributeDefinitionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttributeDefinition` | [`CustomAttributeDefinition \| undefined`](../../doc/models/custom-attribute-definition.md) | Optional | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "custom_attribute_definition": { + "created_at": "2022-12-02T19:06:36.559Z", + "description": "Bestselling item at location", + "key": "bestseller", + "name": "Bestseller", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "updated_at": "2022-12-02T19:06:36.559Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/create-location-request.md b/legacy/doc/models/create-location-request.md new file mode 100644 index 000000000..03f581676 --- /dev/null +++ b/legacy/doc/models/create-location-request.md @@ -0,0 +1,40 @@ + +# Create Location Request + +The request object for the [CreateLocation](../../doc/api/locations.md#create-location) endpoint. + +## Structure + +`CreateLocationRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `location` | [`Location \| undefined`](../../doc/models/location.md) | Optional | Represents one of a business' [locations](https://developer.squareup.com/docs/locations-api). | + +## Example (as JSON) + +```json +{ + "location": { + "address": { + "address_line_1": "1234 Peachtree St. NE", + "administrative_district_level_1": "GA", + "locality": "Atlanta", + "postal_code": "30309", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "sublocality": "sublocality6" + }, + "description": "Midtown Atlanta store", + "name": "Midtown", + "id": "id4", + "timezone": "timezone6", + "capabilities": [ + "CREDIT_CARD_PROCESSING" + ] + } +} +``` + diff --git a/legacy/doc/models/create-location-response.md b/legacy/doc/models/create-location-response.md new file mode 100644 index 000000000..ebe760c63 --- /dev/null +++ b/legacy/doc/models/create-location-response.md @@ -0,0 +1,74 @@ + +# Create Location Response + +The response object returned by the [CreateLocation](../../doc/api/locations.md#create-location) endpoint. + +## Structure + +`CreateLocationResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about [errors](https://developer.squareup.com/docs/build-basics/handling-errors) encountered during the request. | +| `location` | [`Location \| undefined`](../../doc/models/location.md) | Optional | Represents one of a business' [locations](https://developer.squareup.com/docs/locations-api). | + +## Example (as JSON) + +```json +{ + "location": { + "address": { + "address_line_1": "1234 Peachtree St. NE", + "administrative_district_level_1": "GA", + "locality": "Atlanta", + "postal_code": "30309", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "sublocality": "sublocality6" + }, + "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" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/create-loyalty-account-request.md b/legacy/doc/models/create-loyalty-account-request.md new file mode 100644 index 000000000..5a783e4f6 --- /dev/null +++ b/legacy/doc/models/create-loyalty-account-request.md @@ -0,0 +1,35 @@ + +# Create Loyalty Account Request + +A request to create a new loyalty account. + +## Structure + +`CreateLoyaltyAccountRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `loyaltyAccount` | [`LoyaltyAccount`](../../doc/models/loyalty-account.md) | Required | Describes a loyalty account in a [loyalty program](../../doc/models/loyalty-program.md). For more information, see
[Create and Retrieve Loyalty Accounts](https://developer.squareup.com/docs/loyalty-api/loyalty-accounts). | +| `idempotencyKey` | `string` | Required | A unique string that identifies this `CreateLoyaltyAccount` request.
Keys can be any valid string, but must be unique for every request.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128` | + +## Example (as JSON) + +```json +{ + "idempotency_key": "ec78c477-b1c3-4899-a209-a4e71337c996", + "loyalty_account": { + "mapping": { + "phone_number": "+14155551234" + }, + "program_id": "d619f755-2d17-41f3-990d-c04ecedd64dd", + "id": "id6", + "balance": 6, + "lifetime_points": 30, + "customer_id": "customer_id4", + "enrolled_at": "enrolled_at6" + } +} +``` + diff --git a/legacy/doc/models/create-loyalty-account-response.md b/legacy/doc/models/create-loyalty-account-response.md new file mode 100644 index 000000000..e76f9db25 --- /dev/null +++ b/legacy/doc/models/create-loyalty-account-response.md @@ -0,0 +1,46 @@ + +# Create Loyalty Account Response + +A response that includes loyalty account created. + +## Structure + +`CreateLoyaltyAccountResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `loyaltyAccount` | [`LoyaltyAccount \| undefined`](../../doc/models/loyalty-account.md) | Optional | Describes a loyalty account in a [loyalty program](../../doc/models/loyalty-program.md). For more information, see
[Create and Retrieve Loyalty Accounts](https://developer.squareup.com/docs/loyalty-api/loyalty-accounts). | + +## Example (as JSON) + +```json +{ + "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", + "enrolled_at": "enrolled_at6" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/create-loyalty-promotion-request.md b/legacy/doc/models/create-loyalty-promotion-request.md new file mode 100644 index 000000000..ee716c73c --- /dev/null +++ b/legacy/doc/models/create-loyalty-promotion-request.md @@ -0,0 +1,59 @@ + +# Create Loyalty Promotion Request + +Represents a [CreateLoyaltyPromotion](../../doc/api/loyalty.md#create-loyalty-promotion) request. + +## Structure + +`CreateLoyaltyPromotionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `loyaltyPromotion` | [`LoyaltyPromotion`](../../doc/models/loyalty-promotion.md) | Required | Represents a promotion for a [loyalty program](../../doc/models/loyalty-program.md). 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. | +| `idempotencyKey` | `string` | Required | 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).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128` | + +## Example (as JSON) + +```json +{ + "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" + ], + "start_date": "start_date4", + "end_date": "end_date8" + }, + "incentive": { + "points_multiplier_data": { + "multiplier": "3.0", + "points_multiplier": 134 + }, + "type": "POINTS_MULTIPLIER", + "points_addition_data": { + "points_addition": 218 + } + }, + "minimum_spend_amount_money": { + "amount": 2000, + "currency": "USD" + }, + "name": "Tuesday Happy Hour Promo", + "qualifying_category_ids": [ + "XTQPYLR3IIU9C44VRCB3XD12" + ], + "trigger_limit": { + "interval": "DAY", + "times": 1 + }, + "id": "id4", + "status": "ACTIVE", + "created_at": "created_at2", + "canceled_at": "canceled_at0" + } +} +``` + diff --git a/legacy/doc/models/create-loyalty-promotion-response.md b/legacy/doc/models/create-loyalty-promotion-response.md new file mode 100644 index 000000000..069f0e8b0 --- /dev/null +++ b/legacy/doc/models/create-loyalty-promotion-response.md @@ -0,0 +1,75 @@ + +# Create Loyalty Promotion Response + +Represents a [CreateLoyaltyPromotion](../../doc/api/loyalty.md#create-loyalty-promotion) response. +Either `loyalty_promotion` or `errors` is present in the response. + +## Structure + +`CreateLoyaltyPromotionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `loyaltyPromotion` | [`LoyaltyPromotion \| undefined`](../../doc/models/loyalty-promotion.md) | Optional | Represents a promotion for a [loyalty program](../../doc/models/loyalty-program.md). 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. | + +## Example (as JSON) + +```json +{ + "loyalty_promotion": { + "available_time": { + "start_date": "2022-08-16", + "time_periods": [ + "BEGIN:VEVENT\nDTSTART:20220816T160000\nDURATION:PT2H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT" + ], + "end_date": "end_date8" + }, + "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", + "points_addition_data": { + "points_addition": 218 + } + }, + "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", + "canceled_at": "canceled_at0" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/create-loyalty-reward-request.md b/legacy/doc/models/create-loyalty-reward-request.md new file mode 100644 index 000000000..4be49cafc --- /dev/null +++ b/legacy/doc/models/create-loyalty-reward-request.md @@ -0,0 +1,33 @@ + +# Create Loyalty Reward Request + +A request to create a loyalty reward. + +## Structure + +`CreateLoyaltyRewardRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `reward` | [`LoyaltyReward`](../../doc/models/loyalty-reward.md) | Required | Represents a contract to redeem loyalty points for a [reward tier](../../doc/models/loyalty-program-reward-tier.md) 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). | +| `idempotencyKey` | `string` | Required | A unique string that identifies this `CreateLoyaltyReward` request.
Keys can be any valid string, but must be unique for every request.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128` | + +## Example (as JSON) + +```json +{ + "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", + "id": "id0", + "status": "ISSUED", + "points": 222, + "created_at": "created_at8" + } +} +``` + diff --git a/legacy/doc/models/create-loyalty-reward-response.md b/legacy/doc/models/create-loyalty-reward-response.md new file mode 100644 index 000000000..0f2dd0628 --- /dev/null +++ b/legacy/doc/models/create-loyalty-reward-response.md @@ -0,0 +1,47 @@ + +# Create Loyalty Reward Response + +A response that includes the loyalty reward created. + +## Structure + +`CreateLoyaltyRewardResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `reward` | [`LoyaltyReward \| undefined`](../../doc/models/loyalty-reward.md) | Optional | Represents a contract to redeem loyalty points for a [reward tier](../../doc/models/loyalty-program-reward-tier.md) 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). | + +## Example (as JSON) + +```json +{ + "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" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/create-merchant-custom-attribute-definition-request.md b/legacy/doc/models/create-merchant-custom-attribute-definition-request.md new file mode 100644 index 000000000..fdade0677 --- /dev/null +++ b/legacy/doc/models/create-merchant-custom-attribute-definition-request.md @@ -0,0 +1,34 @@ + +# Create Merchant Custom Attribute Definition Request + +Represents a [CreateMerchantCustomAttributeDefinition](../../doc/api/merchant-custom-attributes.md#create-merchant-custom-attribute-definition) request. + +## Structure + +`CreateMerchantCustomAttributeDefinitionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttributeDefinition` | [`CustomAttributeDefinition`](../../doc/models/custom-attribute-definition.md) | Required | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | +| `idempotencyKey` | `string \| undefined` | Optional | 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).
**Constraints**: *Maximum Length*: `45` | + +## Example (as JSON) + +```json +{ + "custom_attribute_definition": { + "description": "This is the other name this merchant goes by.", + "key": "alternative_seller_name", + "name": "Alternative Merchant Name", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "visibility": "VISIBILITY_READ_ONLY" + }, + "idempotency_key": "idempotency_key6" +} +``` + diff --git a/legacy/doc/models/create-merchant-custom-attribute-definition-response.md b/legacy/doc/models/create-merchant-custom-attribute-definition-response.md new file mode 100644 index 000000000..6b7da5e5a --- /dev/null +++ b/legacy/doc/models/create-merchant-custom-attribute-definition-response.md @@ -0,0 +1,45 @@ + +# Create Merchant Custom Attribute Definition Response + +Represents a [CreateMerchantCustomAttributeDefinition](../../doc/api/merchant-custom-attributes.md#create-merchant-custom-attribute-definition) response. +Either `custom_attribute_definition` or `errors` is present in the response. + +## Structure + +`CreateMerchantCustomAttributeDefinitionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttributeDefinition` | [`CustomAttributeDefinition \| undefined`](../../doc/models/custom-attribute-definition.md) | Optional | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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": { + "key1": "val1", + "key2": "val2" + }, + "updated_at": "2023-05-05T19:06:36.559Z", + "version": 1, + "visibility": "VISIBILITY_READ_ONLY" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/create-mobile-authorization-code-request.md b/legacy/doc/models/create-mobile-authorization-code-request.md new file mode 100644 index 000000000..7b858993e --- /dev/null +++ b/legacy/doc/models/create-mobile-authorization-code-request.md @@ -0,0 +1,24 @@ + +# Create Mobile Authorization Code Request + +Defines the body parameters that can be provided in a request to the +`CreateMobileAuthorizationCode` endpoint. + +## Structure + +`CreateMobileAuthorizationCodeRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string \| undefined` | Optional | The Square location ID that the authorization code should be tied to.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `191` | + +## Example (as JSON) + +```json +{ + "location_id": "YOUR_LOCATION_ID" +} +``` + diff --git a/legacy/doc/models/create-mobile-authorization-code-response.md b/legacy/doc/models/create-mobile-authorization-code-response.md new file mode 100644 index 000000000..a936fdca4 --- /dev/null +++ b/legacy/doc/models/create-mobile-authorization-code-response.md @@ -0,0 +1,41 @@ + +# Create Mobile Authorization Code Response + +Defines the fields that are included in the response body of +a request to the `CreateMobileAuthorizationCode` endpoint. + +## Structure + +`CreateMobileAuthorizationCodeResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `authorizationCode` | `string \| undefined` | Optional | The generated authorization code that connects a mobile application instance
to a Square account.
**Constraints**: *Maximum Length*: `191` | +| `expiresAt` | `string \| undefined` | Optional | The timestamp when `authorization_code` expires, in
[RFC 3339](https://tools.ietf.org/html/rfc3339) format (for example, "2016-09-04T23:59:33.123Z").
**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `48` | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "authorization_code": "YOUR_MOBILE_AUTHORIZATION_CODE", + "expires_at": "2019-01-10T19:42:08Z", + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/create-order-custom-attribute-definition-request.md b/legacy/doc/models/create-order-custom-attribute-definition-request.md new file mode 100644 index 000000000..71d2b14d2 --- /dev/null +++ b/legacy/doc/models/create-order-custom-attribute-definition-request.md @@ -0,0 +1,34 @@ + +# Create Order Custom Attribute Definition Request + +Represents a create request for an order custom attribute definition. + +## Structure + +`CreateOrderCustomAttributeDefinitionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttributeDefinition` | [`CustomAttributeDefinition`](../../doc/models/custom-attribute-definition.md) | Required | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | +| `idempotencyKey` | `string \| undefined` | Optional | 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).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `45` | + +## Example (as JSON) + +```json +{ + "custom_attribute_definition": { + "description": "The number of people seated at a table", + "key": "cover-count", + "name": "Cover count", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "idempotency_key": "IDEMPOTENCY_KEY" +} +``` + diff --git a/legacy/doc/models/create-order-custom-attribute-definition-response.md b/legacy/doc/models/create-order-custom-attribute-definition-response.md new file mode 100644 index 000000000..e4a12a0a5 --- /dev/null +++ b/legacy/doc/models/create-order-custom-attribute-definition-response.md @@ -0,0 +1,56 @@ + +# Create Order Custom Attribute Definition Response + +Represents a response from creating an order custom attribute definition. + +## Structure + +`CreateOrderCustomAttributeDefinitionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttributeDefinition` | [`CustomAttributeDefinition \| undefined`](../../doc/models/custom-attribute-definition.md) | Optional | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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": { + "key1": "val1", + "key2": "val2" + }, + "updated_at": "2022-10-06T16:53:23.141Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/create-order-request.md b/legacy/doc/models/create-order-request.md new file mode 100644 index 000000000..8e6efc441 --- /dev/null +++ b/legacy/doc/models/create-order-request.md @@ -0,0 +1,121 @@ + +# Create Order Request + +## Structure + +`CreateOrderRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `order` | [`Order \| undefined`](../../doc/models/order.md) | Optional | 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. | +| `idempotencyKey` | `string \| undefined` | Optional | 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).
**Constraints**: *Maximum Length*: `192` | + +## Example (as JSON) + +```json +{ + "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", + "uid": "uid8", + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note4", + "catalog_object_id": "catalog_object_id2" + }, + { + "applied_discounts": [ + { + "discount_uid": "one-dollar-off" + } + ], + "catalog_object_id": "BEMYCSMIJL46OCDV4KYIKXIB", + "modifiers": [ + { + "catalog_object_id": "CHQX7Y4KY6N5KINJKZCFURPZ" + } + ], + "quantity": "2", + "uid": "uid8", + "name": "name8", + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note4" + } + ], + "location_id": "057P5VYJ4A5X1", + "reference_id": "my-order-001", + "taxes": [ + { + "name": "State Sales Tax", + "percentage": "9", + "scope": "ORDER", + "uid": "state-sales-tax" + } + ], + "id": "id6", + "source": { + "name": "name4" + }, + "customer_id": "customer_id4" + } +} +``` + diff --git a/legacy/doc/models/create-order-response.md b/legacy/doc/models/create-order-response.md new file mode 100644 index 000000000..5546e5695 --- /dev/null +++ b/legacy/doc/models/create-order-response.md @@ -0,0 +1,329 @@ + +# Create Order Response + +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. + +## Structure + +`CreateOrderResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `order` | [`Order \| undefined`](../../doc/models/order.md) | Optional | 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. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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" + }, + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note4", + "catalog_object_id": "catalog_object_id2" + }, + { + "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" + }, + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note4" + } + ], + "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, + "customer_id": "customer_id4" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/create-payment-link-request.md b/legacy/doc/models/create-payment-link-request.md new file mode 100644 index 000000000..013c10c5a --- /dev/null +++ b/legacy/doc/models/create-payment-link-request.md @@ -0,0 +1,83 @@ + +# Create Payment Link Request + +## Structure + +`CreatePaymentLinkRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string \| undefined` | Optional | 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).
**Constraints**: *Maximum Length*: `192` | +| `description` | `string \| undefined` | Optional | A description of the payment link. You provide this optional description that is useful in your
application context. It is not used anywhere.
**Constraints**: *Maximum Length*: `4096` | +| `quickPay` | [`QuickPay \| undefined`](../../doc/models/quick-pay.md) | Optional | 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). | +| `order` | [`Order \| undefined`](../../doc/models/order.md) | Optional | 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. | +| `checkoutOptions` | [`CheckoutOptions \| undefined`](../../doc/models/checkout-options.md) | Optional | - | +| `prePopulatedData` | [`PrePopulatedData \| undefined`](../../doc/models/pre-populated-data.md) | Optional | 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). | +| `paymentNote` | `string \| undefined` | Optional | A note for the payment. After processing the payment, Square adds this note to the resulting `Payment`.
**Constraints**: *Maximum Length*: `500` | + +## Example (as JSON) + +```json +{ + "idempotency_key": "cd9e25dc-d9f2-4430-aedb-61605070e95f", + "quick_pay": { + "location_id": "A9Y43N9ABXZBP", + "name": "Auto Detailing", + "price_money": { + "amount": 10000, + "currency": "USD" + } + }, + "description": "description6", + "order": { + "id": "id6", + "location_id": "location_id0", + "reference_id": "reference_id4", + "source": { + "name": "name4" + }, + "customer_id": "customer_id4", + "line_items": [ + { + "uid": "uid8", + "name": "name8", + "quantity": "quantity4", + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note4", + "catalog_object_id": "catalog_object_id2" + } + ] + }, + "checkout_options": { + "allow_tipping": false, + "custom_fields": [ + { + "title": "title8" + }, + { + "title": "title8" + } + ], + "subscription_plan_id": "subscription_plan_id8", + "redirect_url": "redirect_url2", + "merchant_support_email": "merchant_support_email8" + } +} +``` + diff --git a/legacy/doc/models/create-payment-link-response.md b/legacy/doc/models/create-payment-link-response.md new file mode 100644 index 000000000..972054083 --- /dev/null +++ b/legacy/doc/models/create-payment-link-response.md @@ -0,0 +1,266 @@ + +# Create Payment Link Response + +## Structure + +`CreatePaymentLinkResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `paymentLink` | [`PaymentLink \| undefined`](../../doc/models/payment-link.md) | Optional | - | +| `relatedResources` | [`PaymentLinkRelatedResources \| undefined`](../../doc/models/payment-link-related-resources.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "payment_link": { + "id": "id2", + "version": 184, + "description": "description2", + "order_id": "order_id6", + "checkout_options": { + "allow_tipping": false, + "custom_fields": [ + { + "title": "title8" + }, + { + "title": "title8" + } + ], + "subscription_plan_id": "subscription_plan_id8", + "redirect_url": "redirect_url2", + "merchant_support_email": "merchant_support_email8" + }, + "pre_populated_data": { + "buyer_email": "buyer_email8", + "buyer_phone_number": "buyer_phone_number0", + "buyer_address": { + "address_line_1": "address_line_12", + "address_line_2": "address_line_22", + "address_line_3": "address_line_38", + "locality": "locality2", + "sublocality": "sublocality2" + } + } + }, + "related_resources": { + "orders": [ + { + "id": "id2", + "location_id": "location_id6", + "reference_id": "reference_id0", + "source": { + "name": "name4" + }, + "customer_id": "customer_id0", + "line_items": [ + { + "uid": "uid8", + "name": "name8", + "quantity": "quantity4", + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note4", + "catalog_object_id": "catalog_object_id2" + }, + { + "uid": "uid8", + "name": "name8", + "quantity": "quantity4", + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note4", + "catalog_object_id": "catalog_object_id2" + } + ] + } + ], + "subscription_plans": [ + { + "type": "ITEM_OPTION", + "id": "id4", + "updated_at": "updated_at0", + "version": 112, + "is_deleted": false, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key2": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] + }, + { + "type": "ITEM_OPTION", + "id": "id4", + "updated_at": "updated_at0", + "version": 112, + "is_deleted": false, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key2": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] + }, + { + "type": "ITEM_OPTION", + "id": "id4", + "updated_at": "updated_at0", + "version": 112, + "is_deleted": false, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key2": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] + } + ] + } +} +``` + diff --git a/legacy/doc/models/create-payment-request.md b/legacy/doc/models/create-payment-request.md new file mode 100644 index 000000000..07db5973c --- /dev/null +++ b/legacy/doc/models/create-payment-request.md @@ -0,0 +1,68 @@ + +# Create Payment Request + +Describes a request to create a payment using +[CreatePayment](../../doc/api/payments.md#create-payment). + +## Structure + +`CreatePaymentRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `sourceId` | `string` | Required | 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).
**Constraints**: *Minimum Length*: `1` | +| `idempotencyKey` | `string` | Required | 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).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `45` | +| `amountMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `tipMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `appFeeMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `delayDuration` | `string \| undefined` | Optional | 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. | +| `delayAction` | `string \| undefined` | Optional | 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` | `boolean \| undefined` | Optional | 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 | +| `orderId` | `string \| undefined` | Optional | Associates a previously created order with this payment. | +| `customerId` | `string \| undefined` | Optional | 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. | +| `locationId` | `string \| undefined` | Optional | 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. | +| `teamMemberId` | `string \| undefined` | Optional | An optional [TeamMember](entity:TeamMember) ID to associate with
this payment. | +| `referenceId` | `string \| undefined` | Optional | 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).
**Constraints**: *Maximum Length*: `40` | +| `verificationToken` | `string \| undefined` | Optional | 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). | +| `acceptPartialAuthorization` | `boolean \| undefined` | Optional | 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 | +| `buyerEmailAddress` | `string \| undefined` | Optional | The buyer's email address.
**Constraints**: *Maximum Length*: `255` | +| `buyerPhoneNumber` | `string \| undefined` | Optional | 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. | +| `billingAddress` | [`Address \| undefined`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | +| `shippingAddress` | [`Address \| undefined`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | +| `note` | `string \| undefined` | Optional | An optional note to be entered by the developer when creating a payment.
**Constraints**: *Maximum Length*: `500` | +| `statementDescriptionIdentifier` | `string \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `20` | +| `cashDetails` | [`CashPaymentDetails \| undefined`](../../doc/models/cash-payment-details.md) | Optional | 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). | +| `externalDetails` | [`ExternalPaymentDetails \| undefined`](../../doc/models/external-payment-details.md) | Optional | 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). | +| `customerDetails` | [`CustomerDetails \| undefined`](../../doc/models/customer-details.md) | Optional | Details about the customer making the payment. | +| `offlinePaymentDetails` | [`OfflinePaymentDetails \| undefined`](../../doc/models/offline-payment-details.md) | Optional | Details specific to offline payments. | + +## Example (as JSON) + +```json +{ + "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", + "tip_money": { + "amount": 190, + "currency": "TWD" + }, + "delay_duration": "delay_duration6", + "delay_action": "delay_action6" +} +``` + diff --git a/legacy/doc/models/create-payment-response.md b/legacy/doc/models/create-payment-response.md new file mode 100644 index 000000000..3f73afcfc --- /dev/null +++ b/legacy/doc/models/create-payment-response.md @@ -0,0 +1,114 @@ + +# Create Payment Response + +Defines the response returned by [CreatePayment](../../doc/api/payments.md#create-payment). + +If there are errors processing the request, the `payment` field might not be +present, or it might be present with a status of `FAILED`. + +## Structure + +`CreatePaymentResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | +| `payment` | [`Payment \| undefined`](../../doc/models/payment.md) | Optional | Represents a payment processed by the Square API. | + +## Example (as JSON) + +```json +{ + "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", + "tip_money": { + "amount": 190, + "currency": "TWD" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/create-refund-request.md b/legacy/doc/models/create-refund-request.md new file mode 100644 index 000000000..a754edb7e --- /dev/null +++ b/legacy/doc/models/create-refund-request.md @@ -0,0 +1,35 @@ + +# Create Refund Request + +Defines the body parameters that can be included in +a request to the [CreateRefund](api-endpoint:Transactions-CreateRefund) endpoint. + +Deprecated - recommend using [RefundPayment](api-endpoint:Refunds-RefundPayment) + +## Structure + +`CreateRefundRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string` | Required | A value you specify that uniquely identifies this
refund among refunds you've created for the tender.

If you're unsure whether a particular refund succeeded,
you can reattempt it with the same idempotency key without
worrying about duplicating the refund.

See [Idempotency keys](https://developer.squareup.com/docs/working-with-apis/idempotency) for more information.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `192` | +| `tenderId` | `string` | Required | The ID of the tender to refund.

A [`Transaction`](entity:Transaction) has one or more `tenders` (i.e., methods
of payment) associated with it, and you refund each tender separately with
the Connect API.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `192` | +| `reason` | `string \| undefined` | Optional | A description of the reason for the refund.

Default value: `Refund via API`
**Constraints**: *Maximum Length*: `192` | +| `amountMoney` | [`Money`](../../doc/models/money.md) | Required | 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. | + +## Example (as JSON) + +```json +{ + "amount_money": { + "amount": 100, + "currency": "USD" + }, + "idempotency_key": "86ae1696-b1e3-4328-af6d-f1e04d947ad2", + "reason": "a reason", + "tender_id": "MtZRYYdDrYNQbOvV7nbuBvMF" +} +``` + diff --git a/legacy/doc/models/create-refund-response.md b/legacy/doc/models/create-refund-response.md new file mode 100644 index 000000000..ad72a75e0 --- /dev/null +++ b/legacy/doc/models/create-refund-response.md @@ -0,0 +1,68 @@ + +# Create Refund Response + +Defines the fields that are included in the response body of +a request to the [CreateRefund](api-endpoint:Transactions-CreateRefund) endpoint. + +One of `errors` or `refund` is present in a given response (never both). + +## Structure + +`CreateRefundResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `refund` | [`Refund \| undefined`](../../doc/models/refund.md) | Optional | Represents a refund processed for a Square transaction. | + +## Example (as JSON) + +```json +{ + "refund": { + "additional_recipients": [ + { + "amount_money": { + "amount": 10, + "currency": "USD" + }, + "description": "Application fees", + "location_id": "057P5VYJ4A5X1", + "receivable_id": "ISu5xwxJ5v0CMJTQq7RvqyMF" + } + ], + "amount_money": { + "amount": 100, + "currency": "USD" + }, + "created_at": "2016-02-12T00:28:18Z", + "id": "b27436d1-7f8e-5610-45c6-417ef71434b4-SW", + "location_id": "18YC4JDH91E1H", + "reason": "some reason", + "status": "PENDING", + "tender_id": "MtZRYYdDrYNQbOvV7nbuBvMF", + "transaction_id": "KnL67ZIwXCPtzOrqj0HrkxMF", + "processing_fee_money": { + "amount": 112, + "currency": "DJF" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/create-shift-request.md b/legacy/doc/models/create-shift-request.md new file mode 100644 index 000000000..bb243c73d --- /dev/null +++ b/legacy/doc/models/create-shift-request.md @@ -0,0 +1,56 @@ + +# Create Shift Request + +Represents a request to create a `Shift`. + +## Structure + +`CreateShiftRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string \| undefined` | Optional | A unique string value to ensure the idempotency of the operation.
**Constraints**: *Maximum Length*: `128` | +| `shift` | [`Shift`](../../doc/models/shift.md) | Required | 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. | + +## Example (as JSON) + +```json +{ + "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", + "job_id": "job_id0" + }, + "id": "id4", + "employee_id": "employee_id4", + "timezone": "timezone4" + } +} +``` + diff --git a/legacy/doc/models/create-shift-response.md b/legacy/doc/models/create-shift-response.md new file mode 100644 index 000000000..6c3f8b3e6 --- /dev/null +++ b/legacy/doc/models/create-shift-response.md @@ -0,0 +1,82 @@ + +# Create Shift Response + +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. + +## Structure + +`CreateShiftResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `shift` | [`Shift \| undefined`](../../doc/models/shift.md) | Optional | 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. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/create-subscription-request.md b/legacy/doc/models/create-subscription-request.md new file mode 100644 index 000000000..964e50538 --- /dev/null +++ b/legacy/doc/models/create-subscription-request.md @@ -0,0 +1,53 @@ + +# Create Subscription Request + +Defines input parameters in a request to the +[CreateSubscription](../../doc/api/subscriptions.md#create-subscription) endpoint. + +## Structure + +`CreateSubscriptionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string \| undefined` | Optional | 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). | +| `locationId` | `string` | Required | The ID of the location the subscription is associated with.
**Constraints**: *Minimum Length*: `1` | +| `planVariationId` | `string \| undefined` | Optional | The ID of the [subscription plan variation](https://developer.squareup.com/docs/subscriptions-api/plans-and-variations#plan-variations) created using the Catalog API. | +| `customerId` | `string` | Required | The ID of the [customer](entity:Customer) subscribing to the subscription plan variation.
**Constraints**: *Minimum Length*: `1` | +| `startDate` | `string \| undefined` | Optional | The `YYYY-MM-DD`-formatted date to start the subscription.
If it is unspecified, the subscription starts immediately. | +| `canceledDate` | `string \| undefined` | Optional | 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 expires, the specified `canceled_date` sets the date when the subscription
stops through the end of the last cycle. | +| `taxPercentage` | `string \| undefined` | Optional | 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%.
**Constraints**: *Maximum Length*: `10` | +| `priceOverrideMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `cardId` | `string \| undefined` | Optional | 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` | `string \| undefined` | Optional | 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` | [`SubscriptionSource \| undefined`](../../doc/models/subscription-source.md) | Optional | The origination details of the subscription. | +| `monthlyBillingAnchorDate` | `number \| undefined` | Optional | The day-of-the-month to change the billing date to.
**Constraints**: `>= 1`, `<= 31` | +| `phases` | [`Phase[] \| undefined`](../../doc/models/phase.md) | Optional | array of phases for this subscription | + +## Example (as JSON) + +```json +{ + "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", + "canceled_date": "canceled_date6", + "tax_percentage": "tax_percentage6" +} +``` + diff --git a/legacy/doc/models/create-subscription-response.md b/legacy/doc/models/create-subscription-response.md new file mode 100644 index 000000000..c55aebbaa --- /dev/null +++ b/legacy/doc/models/create-subscription-response.md @@ -0,0 +1,67 @@ + +# Create Subscription Response + +Defines output parameters in a response from the +[CreateSubscription](../../doc/api/subscriptions.md#create-subscription) endpoint. + +## Structure + +`CreateSubscriptionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Errors encountered during the request. | +| `subscription` | [`Subscription \| undefined`](../../doc/models/subscription.md) | Optional | Represents a subscription purchased by a customer.

For more information, see
[Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). | + +## Example (as JSON) + +```json +{ + "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 + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/create-team-member-request.md b/legacy/doc/models/create-team-member-request.md new file mode 100644 index 000000000..69a6e738f --- /dev/null +++ b/legacy/doc/models/create-team-member-request.md @@ -0,0 +1,63 @@ + +# Create Team Member Request + +Represents a create request for a `TeamMember` object. + +## Structure + +`CreateTeamMemberRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string \| undefined` | Optional | 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. | +| `teamMember` | [`TeamMember \| undefined`](../../doc/models/team-member.md) | Optional | A record representing an individual team member for a business. | + +## Example (as JSON) + +```json +{ + "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" + } + ] + }, + "id": "id6", + "is_owner": false + } +} +``` + diff --git a/legacy/doc/models/create-team-member-response.md b/legacy/doc/models/create-team-member-response.md new file mode 100644 index 000000000..a37f9a918 --- /dev/null +++ b/legacy/doc/models/create-team-member-response.md @@ -0,0 +1,94 @@ + +# Create Team Member Response + +Represents a response from a create request containing the created `TeamMember` object or error messages. + +## Structure + +`CreateTeamMemberResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `teamMember` | [`TeamMember \| undefined`](../../doc/models/team-member.md) | Optional | A record representing an individual team member for a business. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | The errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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 + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/create-terminal-action-request.md b/legacy/doc/models/create-terminal-action-request.md new file mode 100644 index 000000000..39e1d1b5a --- /dev/null +++ b/legacy/doc/models/create-terminal-action-request.md @@ -0,0 +1,34 @@ + +# Create Terminal Action Request + +## Structure + +`CreateTerminalActionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string` | Required | 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.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `64` | +| `action` | [`TerminalAction`](../../doc/models/terminal-action.md) | Required | Represents an action processed by the Square Terminal. | + +## Example (as JSON) + +```json +{ + "action": { + "deadline_duration": "PT5M", + "device_id": "{{DEVICE_ID}}", + "save_card_options": { + "customer_id": "{{CUSTOMER_ID}}", + "reference_id": "user-id-1" + }, + "type": "SAVE_CARD", + "id": "id2", + "status": "status4", + "cancel_reason": "TIMED_OUT" + }, + "idempotency_key": "thahn-70e75c10-47f7-4ab6-88cc-aaa4076d065e" +} +``` + diff --git a/legacy/doc/models/create-terminal-action-response.md b/legacy/doc/models/create-terminal-action-response.md new file mode 100644 index 000000000..b1ff95e77 --- /dev/null +++ b/legacy/doc/models/create-terminal-action-response.md @@ -0,0 +1,51 @@ + +# Create Terminal Action Response + +## Structure + +`CreateTerminalActionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | +| `action` | [`TerminalAction \| undefined`](../../doc/models/terminal-action.md) | Optional | Represents an action processed by the Square Terminal. | + +## Example (as JSON) + +```json +{ + "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", + "cancel_reason": "TIMED_OUT" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/create-terminal-checkout-request.md b/legacy/doc/models/create-terminal-checkout-request.md new file mode 100644 index 000000000..7c0db0f33 --- /dev/null +++ b/legacy/doc/models/create-terminal-checkout-request.md @@ -0,0 +1,53 @@ + +# Create Terminal Checkout Request + +## Structure + +`CreateTerminalCheckoutRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string` | Required | 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.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `64` | +| `checkout` | [`TerminalCheckout`](../../doc/models/terminal-checkout.md) | Required | Represents a checkout processed by the Square Terminal. | + +## Example (as JSON) + +```json +{ + "checkout": { + "amount_money": { + "amount": 2610, + "currency": "USD" + }, + "device_options": { + "device_id": "dbb5d83a-7838-11ea-bc55-0242ac130003", + "skip_receipt_screen": false, + "collect_signature": false, + "tip_settings": { + "allow_tipping": false, + "separate_tip_screen": false, + "custom_tip_field": false, + "tip_percentages": [ + 48 + ], + "smart_tipping": false + }, + "show_itemized_cart": false + }, + "note": "A brief note", + "reference_id": "id11572", + "id": "id2", + "order_id": "order_id6", + "payment_options": { + "autocomplete": false, + "delay_duration": "delay_duration2", + "accept_partial_authorization": false, + "delay_action": "CANCEL" + } + }, + "idempotency_key": "28a0c3bc-7839-11ea-bc55-0242ac130003" +} +``` + diff --git a/legacy/doc/models/create-terminal-checkout-response.md b/legacy/doc/models/create-terminal-checkout-response.md new file mode 100644 index 000000000..e194fb341 --- /dev/null +++ b/legacy/doc/models/create-terminal-checkout-response.md @@ -0,0 +1,67 @@ + +# Create Terminal Checkout Response + +## Structure + +`CreateTerminalCheckoutResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | +| `checkout` | [`TerminalCheckout \| undefined`](../../doc/models/terminal-checkout.md) | Optional | Represents a checkout processed by the Square Terminal. | + +## Example (as JSON) + +```json +{ + "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, + "separate_tip_screen": false, + "custom_tip_field": false, + "tip_percentages": [ + 48 + ], + "smart_tipping": false + }, + "collect_signature": false, + "show_itemized_cart": 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", + "order_id": "order_id6", + "payment_options": { + "autocomplete": false, + "delay_duration": "delay_duration2", + "accept_partial_authorization": false, + "delay_action": "CANCEL" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/create-terminal-refund-request.md b/legacy/doc/models/create-terminal-refund-request.md new file mode 100644 index 000000000..8126be2f9 --- /dev/null +++ b/legacy/doc/models/create-terminal-refund-request.md @@ -0,0 +1,36 @@ + +# Create Terminal Refund Request + +## Structure + +`CreateTerminalRefundRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string` | Required | 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.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `64` | +| `refund` | [`TerminalRefund \| undefined`](../../doc/models/terminal-refund.md) | Optional | Represents a payment refund processed by the Square Terminal. Only supports Interac (Canadian debit network) payment refunds. | + +## Example (as JSON) + +```json +{ + "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", + "id": "id8", + "refund_id": "refund_id2", + "order_id": "order_id2", + "deadline_duration": "deadline_duration0", + "status": "status0" + } +} +``` + diff --git a/legacy/doc/models/create-terminal-refund-response.md b/legacy/doc/models/create-terminal-refund-response.md new file mode 100644 index 000000000..7018aa5c4 --- /dev/null +++ b/legacy/doc/models/create-terminal-refund-response.md @@ -0,0 +1,56 @@ + +# Create Terminal Refund Response + +## Structure + +`CreateTerminalRefundResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | +| `refund` | [`TerminalRefund \| undefined`](../../doc/models/terminal-refund.md) | Optional | Represents a payment refund processed by the Square Terminal. Only supports Interac (Canadian debit network) payment refunds. | + +## Example (as JSON) + +```json +{ + "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", + "refund_id": "refund_id2" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/create-vendor-request.md b/legacy/doc/models/create-vendor-request.md new file mode 100644 index 000000000..a75219ca8 --- /dev/null +++ b/legacy/doc/models/create-vendor-request.md @@ -0,0 +1,37 @@ + +# Create Vendor Request + +Represents an input to a call to [CreateVendor](../../doc/api/vendors.md#create-vendor). + +## Structure + +`CreateVendorRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string` | Required | 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.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128` | +| `vendor` | [`Vendor \| undefined`](../../doc/models/vendor.md) | Optional | Represents a supplier to a seller. | + +## Example (as JSON) + +```json +{ + "idempotency_key": "idempotency_key6", + "vendor": { + "id": "id6", + "created_at": "created_at4", + "updated_at": "updated_at2", + "name": "name6", + "address": { + "address_line_1": "address_line_16", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "locality": "locality6", + "sublocality": "sublocality6" + } + } +} +``` + diff --git a/legacy/doc/models/create-vendor-response.md b/legacy/doc/models/create-vendor-response.md new file mode 100644 index 000000000..5a715d6aa --- /dev/null +++ b/legacy/doc/models/create-vendor-response.md @@ -0,0 +1,50 @@ + +# Create Vendor Response + +Represents an output from a call to [CreateVendor](../../doc/api/vendors.md#create-vendor). + +## Structure + +`CreateVendorResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Errors encountered when the request fails. | +| `vendor` | [`Vendor \| undefined`](../../doc/models/vendor.md) | Optional | Represents a supplier to a seller. | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "vendor": { + "id": "id6", + "created_at": "created_at4", + "updated_at": "updated_at2", + "name": "name6", + "address": { + "address_line_1": "address_line_16", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "locality": "locality6", + "sublocality": "sublocality6" + } + } +} +``` + diff --git a/legacy/doc/models/create-webhook-subscription-request.md b/legacy/doc/models/create-webhook-subscription-request.md new file mode 100644 index 000000000..194089d9b --- /dev/null +++ b/legacy/doc/models/create-webhook-subscription-request.md @@ -0,0 +1,35 @@ + +# Create Webhook Subscription Request + +Creates a [Subscription](../../doc/models/webhook-subscription.md). + +## Structure + +`CreateWebhookSubscriptionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string \| undefined` | Optional | A unique string that identifies the [CreateWebhookSubscription](api-endpoint:WebhookSubscriptions-CreateWebhookSubscription) request.
**Constraints**: *Maximum Length*: `45` | +| `subscription` | [`WebhookSubscription`](../../doc/models/webhook-subscription.md) | Required | Represents the details of a webhook subscription, including notification URL,
event types, and signature key. | + +## Example (as JSON) + +```json +{ + "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", + "id": "id4", + "enabled": false + } +} +``` + diff --git a/legacy/doc/models/create-webhook-subscription-response.md b/legacy/doc/models/create-webhook-subscription-response.md new file mode 100644 index 000000000..916d36df5 --- /dev/null +++ b/legacy/doc/models/create-webhook-subscription-response.md @@ -0,0 +1,49 @@ + +# Create Webhook Subscription Response + +Defines the fields that are included in the response body of +a request to the [CreateWebhookSubscription](../../doc/api/webhook-subscriptions.md#create-webhook-subscription) endpoint. + +Note: if there are errors processing the request, the [Subscription](../../doc/models/webhook-subscription.md) will not be +present. + +## Structure + +`CreateWebhookSubscriptionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | +| `subscription` | [`WebhookSubscription \| undefined`](../../doc/models/webhook-subscription.md) | Optional | Represents the details of a webhook subscription, including notification URL,
event types, and signature key. | + +## Example (as JSON) + +```json +{ + "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" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/currency.md b/legacy/doc/models/currency.md new file mode 100644 index 000000000..3667d5fe5 --- /dev/null +++ b/legacy/doc/models/currency.md @@ -0,0 +1,198 @@ + +# Currency + +Indicates the associated currency for an amount of money. Values correspond +to [ISO 4217](https://wikipedia.org/wiki/ISO_4217). + +## Enumeration + +`Currency` + +## Fields + +| Name | Description | +| --- | --- | +| `UNKNOWN_CURRENCY` | Unknown currency | +| `AED` | United Arab Emirates dirham | +| `AFN` | Afghan afghani | +| `ALL` | Albanian lek | +| `AMD` | Armenian dram | +| `ANG` | Netherlands Antillean guilder | +| `AOA` | Angolan kwanza | +| `ARS` | Argentine peso | +| `AUD` | Australian dollar | +| `AWG` | Aruban florin | +| `AZN` | Azerbaijani manat | +| `BAM` | Bosnia and Herzegovina convertible mark | +| `BBD` | Barbados dollar | +| `BDT` | Bangladeshi taka | +| `BGN` | Bulgarian lev | +| `BHD` | Bahraini dinar | +| `BIF` | Burundian franc | +| `BMD` | Bermudian dollar | +| `BND` | Brunei dollar | +| `BOB` | Boliviano | +| `BOV` | Bolivian Mvdol | +| `BRL` | Brazilian real | +| `BSD` | Bahamian dollar | +| `BTN` | Bhutanese ngultrum | +| `BWP` | Botswana pula | +| `BYR` | Belarusian ruble | +| `BZD` | Belize dollar | +| `CAD` | Canadian dollar | +| `CDF` | Congolese franc | +| `CHE` | WIR Euro | +| `CHF` | Swiss franc | +| `CHW` | WIR Franc | +| `CLF` | Unidad de Fomento | +| `CLP` | Chilean peso | +| `CNY` | Chinese yuan | +| `COP` | Colombian peso | +| `COU` | Unidad de Valor Real | +| `CRC` | Costa Rican colon | +| `CUC` | Cuban convertible peso | +| `CUP` | Cuban peso | +| `CVE` | Cape Verdean escudo | +| `CZK` | Czech koruna | +| `DJF` | Djiboutian franc | +| `DKK` | Danish krone | +| `DOP` | Dominican peso | +| `DZD` | Algerian dinar | +| `EGP` | Egyptian pound | +| `ERN` | Eritrean nakfa | +| `ETB` | Ethiopian birr | +| `EUR` | Euro | +| `FJD` | Fiji dollar | +| `FKP` | Falkland Islands pound | +| `GBP` | Pound sterling | +| `GEL` | Georgian lari | +| `GHS` | Ghanaian cedi | +| `GIP` | Gibraltar pound | +| `GMD` | Gambian dalasi | +| `GNF` | Guinean franc | +| `GTQ` | Guatemalan quetzal | +| `GYD` | Guyanese dollar | +| `HKD` | Hong Kong dollar | +| `HNL` | Honduran lempira | +| `HRK` | Croatian kuna | +| `HTG` | Haitian gourde | +| `HUF` | Hungarian forint | +| `IDR` | Indonesian rupiah | +| `ILS` | Israeli new shekel | +| `INR` | Indian rupee | +| `IQD` | Iraqi dinar | +| `IRR` | Iranian rial | +| `ISK` | Icelandic króna | +| `JMD` | Jamaican dollar | +| `JOD` | Jordanian dinar | +| `JPY` | Japanese yen | +| `KES` | Kenyan shilling | +| `KGS` | Kyrgyzstani som | +| `KHR` | Cambodian riel | +| `KMF` | Comoro franc | +| `KPW` | North Korean won | +| `KRW` | South Korean won | +| `KWD` | Kuwaiti dinar | +| `KYD` | Cayman Islands dollar | +| `KZT` | Kazakhstani tenge | +| `LAK` | Lao kip | +| `LBP` | Lebanese pound | +| `LKR` | Sri Lankan rupee | +| `LRD` | Liberian dollar | +| `LSL` | Lesotho loti | +| `LTL` | Lithuanian litas | +| `LVL` | Latvian lats | +| `LYD` | Libyan dinar | +| `MAD` | Moroccan dirham | +| `MDL` | Moldovan leu | +| `MGA` | Malagasy ariary | +| `MKD` | Macedonian denar | +| `MMK` | Myanmar kyat | +| `MNT` | Mongolian tögrög | +| `MOP` | Macanese pataca | +| `MRO` | Mauritanian ouguiya | +| `MUR` | Mauritian rupee | +| `MVR` | Maldivian rufiyaa | +| `MWK` | Malawian kwacha | +| `MXN` | Mexican peso | +| `MXV` | Mexican Unidad de Inversion | +| `MYR` | Malaysian ringgit | +| `MZN` | Mozambican metical | +| `NAD` | Namibian dollar | +| `NGN` | Nigerian naira | +| `NIO` | Nicaraguan córdoba | +| `NOK` | Norwegian krone | +| `NPR` | Nepalese rupee | +| `NZD` | New Zealand dollar | +| `OMR` | Omani rial | +| `PAB` | Panamanian balboa | +| `PEN` | Peruvian sol | +| `PGK` | Papua New Guinean kina | +| `PHP` | Philippine peso | +| `PKR` | Pakistani rupee | +| `PLN` | Polish złoty | +| `PYG` | Paraguayan guaraní | +| `QAR` | Qatari riyal | +| `RON` | Romanian leu | +| `RSD` | Serbian dinar | +| `RUB` | Russian ruble | +| `RWF` | Rwandan franc | +| `SAR` | Saudi riyal | +| `SBD` | Solomon Islands dollar | +| `SCR` | Seychelles rupee | +| `SDG` | Sudanese pound | +| `SEK` | Swedish krona | +| `SGD` | Singapore dollar | +| `SHP` | Saint Helena pound | +| `SLL` | Sierra Leonean first leone | +| `SLE` | Sierra Leonean second leone | +| `SOS` | Somali shilling | +| `SRD` | Surinamese dollar | +| `SSP` | South Sudanese pound | +| `STD` | São Tomé and Príncipe dobra | +| `SVC` | Salvadoran colón | +| `SYP` | Syrian pound | +| `SZL` | Swazi lilangeni | +| `THB` | Thai baht | +| `TJS` | Tajikstani somoni | +| `TMT` | Turkmenistan manat | +| `TND` | Tunisian dinar | +| `TOP` | Tongan pa'anga | +| `TRY` | Turkish lira | +| `TTD` | Trinidad and Tobago dollar | +| `TWD` | New Taiwan dollar | +| `TZS` | Tanzanian shilling | +| `UAH` | Ukrainian hryvnia | +| `UGX` | Ugandan shilling | +| `USD` | United States dollar | +| `USN` | United States dollar (next day) | +| `USS` | United States dollar (same day) | +| `UYI` | Uruguay Peso en Unidedades Indexadas | +| `UYU` | Uruguyan peso | +| `UZS` | Uzbekistan som | +| `VEF` | Venezuelan bolívar soberano | +| `VND` | Vietnamese đồng | +| `VUV` | Vanuatu vatu | +| `WST` | Samoan tala | +| `XAF` | CFA franc BEAC | +| `XAG` | Silver | +| `XAU` | Gold | +| `XBA` | European Composite Unit | +| `XBB` | European Monetary Unit | +| `XBC` | European Unit of Account 9 | +| `XBD` | European Unit of Account 17 | +| `XCD` | East Caribbean dollar | +| `XDR` | Special drawing rights (International Monetary Fund) | +| `XOF` | CFA franc BCEAO | +| `XPD` | Palladium | +| `XPF` | CFP franc | +| `XPT` | Platinum | +| `XTS` | Code reserved for testing | +| `XXX` | No currency | +| `YER` | Yemeni rial | +| `ZAR` | South African rand | +| `ZMK` | Zambian kwacha | +| `ZMW` | Zambian kwacha | +| `BTC` | Bitcoin | +| `XUS` | USD Coin | + diff --git a/legacy/doc/models/custom-attribute-definition-visibility.md b/legacy/doc/models/custom-attribute-definition-visibility.md new file mode 100644 index 000000000..3e51a4af5 --- /dev/null +++ b/legacy/doc/models/custom-attribute-definition-visibility.md @@ -0,0 +1,20 @@ + +# Custom Attribute Definition Visibility + +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. + +## Enumeration + +`CustomAttributeDefinitionVisibility` + +## Fields + +| Name | Description | +| --- | --- | +| `VISIBILITY_HIDDEN` | The custom attribute definition and values are hidden from the seller (except on export
of all seller data) and other developers. | +| `VISIBILITY_READ_ONLY` | The seller and other developers can read the custom attribute definition and values
on resources. | +| `VISIBILITY_READ_WRITE_VALUES` | The seller and other developers can read the custom attribute definition,
and can read and write values on resources. A custom attribute definition
can only be edited or deleted by the application that created it. | + diff --git a/legacy/doc/models/custom-attribute-definition.md b/legacy/doc/models/custom-attribute-definition.md new file mode 100644 index 000000000..2d3f55689 --- /dev/null +++ b/legacy/doc/models/custom-attribute-definition.md @@ -0,0 +1,38 @@ + +# Custom Attribute Definition + +Represents a definition for custom attribute values. A custom attribute definition +specifies the key, visibility, schema, and other properties for a custom attribute. + +## Structure + +`CustomAttributeDefinition` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `key` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Minimum Length*: `1`, *Pattern*: `^([a-zA-Z0-9\._-]+:)?[a-zA-Z0-9\._-]{1,60}$` | +| `schema` | `Record \| null \| undefined` | Optional | 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` | `string \| null \| undefined` | Optional | 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`.
**Constraints**: *Maximum Length*: `255` | +| `description` | `string \| null \| undefined` | Optional | 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`.
**Constraints**: *Maximum Length*: `255` | +| `visibility` | [`string \| undefined`](../../doc/models/custom-attribute-definition-visibility.md) | Optional | 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. | +| `version` | `number \| undefined` | Optional | 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). | +| `updatedAt` | `string \| undefined` | Optional | The timestamp that indicates when the custom attribute definition was created or most recently updated,
in RFC 3339 format. | +| `createdAt` | `string \| undefined` | Optional | The timestamp that indicates when the custom attribute definition was created, in RFC 3339 format. | + +## Example (as JSON) + +```json +{ + "key": "key8", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name8", + "description": "description2", + "visibility": "VISIBILITY_READ_WRITE_VALUES" +} +``` + diff --git a/legacy/doc/models/custom-attribute-filter.md b/legacy/doc/models/custom-attribute-filter.md new file mode 100644 index 000000000..a794d81c1 --- /dev/null +++ b/legacy/doc/models/custom-attribute-filter.md @@ -0,0 +1,41 @@ + +# Custom Attribute Filter + +Supported custom attribute query expressions for calling the +[SearchCatalogItems](../../doc/api/catalog.md#search-catalog-items) +endpoint to search for items or item variations. + +## Structure + +`CustomAttributeFilter` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttributeDefinitionId` | `string \| null \| undefined` | Optional | 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` | `string \| null \| undefined` | Optional | 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. | +| `stringFilter` | `string \| null \| undefined` | Optional | 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. | +| `numberFilter` | [`Range \| undefined`](../../doc/models/range.md) | Optional | The range of a number value between the specified lower and upper bounds. | +| `selectionUidsFilter` | `string[] \| null \| undefined` | Optional | 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. | +| `boolFilter` | `boolean \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "custom_attribute_definition_id": "custom_attribute_definition_id0", + "key": "key2", + "string_filter": "string_filter4", + "number_filter": { + "min": "min8", + "max": "max4" + }, + "selection_uids_filter": [ + "selection_uids_filter0", + "selection_uids_filter9", + "selection_uids_filter8" + ] +} +``` + diff --git a/legacy/doc/models/custom-attribute.md b/legacy/doc/models/custom-attribute.md new file mode 100644 index 000000000..49a428aee --- /dev/null +++ b/legacy/doc/models/custom-attribute.md @@ -0,0 +1,46 @@ + +# Custom Attribute + +A custom attribute value. Each custom attribute value has a corresponding +`CustomAttributeDefinition` object. + +## Structure + +`CustomAttribute` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `key` | `string \| null \| undefined` | Optional | 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 (-).
**Constraints**: *Minimum Length*: `1`, *Pattern*: `^([a-zA-Z0-9\._-]+:)?[a-zA-Z0-9\._-]{1,60}$` | +| `value` | `unknown \| null \| undefined` | Optional | 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` | `number \| undefined` | Optional | 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` | [`string \| undefined`](../../doc/models/custom-attribute-definition-visibility.md) | Optional | 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. | +| `definition` | [`CustomAttributeDefinition \| undefined`](../../doc/models/custom-attribute-definition.md) | Optional | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | +| `updatedAt` | `string \| undefined` | Optional | The timestamp that indicates when the custom attribute was created or was most recently
updated, in RFC 3339 format. | +| `createdAt` | `string \| undefined` | Optional | The timestamp that indicates when the custom attribute was created, in RFC 3339 format. | + +## Example (as JSON) + +```json +{ + "key": "key0", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 20, + "visibility": "VISIBILITY_HIDDEN", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } +} +``` + diff --git a/legacy/doc/models/custom-field.md b/legacy/doc/models/custom-field.md new file mode 100644 index 000000000..fde8072e7 --- /dev/null +++ b/legacy/doc/models/custom-field.md @@ -0,0 +1,25 @@ + +# Custom Field + +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). + +## Structure + +`CustomField` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `title` | `string` | Required | The title of the custom field.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `50` | + +## Example (as JSON) + +```json +{ + "title": "title4" +} +``` + diff --git a/legacy/doc/models/customer-address-filter.md b/legacy/doc/models/customer-address-filter.md new file mode 100644 index 000000000..ed696891f --- /dev/null +++ b/legacy/doc/models/customer-address-filter.md @@ -0,0 +1,29 @@ + +# Customer Address Filter + +The customer address filter. This filter is used in a [CustomerCustomAttributeFilterValue](../../doc/models/customer-custom-attribute-filter-value.md) filter when +searching by an `Address`-type custom attribute. + +## Structure + +`CustomerAddressFilter` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `postalCode` | [`CustomerTextFilter \| undefined`](../../doc/models/customer-text-filter.md) | Optional | 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. | +| `country` | [`string \| undefined`](../../doc/models/country.md) | Optional | 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). | + +## Example (as JSON) + +```json +{ + "postal_code": { + "exact": "exact2", + "fuzzy": "fuzzy2" + }, + "country": "ZM" +} +``` + diff --git a/legacy/doc/models/customer-creation-source-filter.md b/legacy/doc/models/customer-creation-source-filter.md new file mode 100644 index 000000000..1a5204fbf --- /dev/null +++ b/legacy/doc/models/customer-creation-source-filter.md @@ -0,0 +1,32 @@ + +# Customer Creation Source Filter + +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. + +## Structure + +`CustomerCreationSourceFilter` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `values` | [`string[] \| null \| undefined`](../../doc/models/customer-creation-source.md) | Optional | The list of creation sources used as filtering criteria.
See [CustomerCreationSource](#type-customercreationsource) for possible values | +| `rule` | [`string \| undefined`](../../doc/models/customer-inclusion-exclusion.md) | Optional | Indicates whether customers should be included in, or excluded from,
the result set when they match the filtering criteria. | + +## Example (as JSON) + +```json +{ + "values": [ + "EGIFTING", + "EMAIL_COLLECTION", + "FEEDBACK" + ], + "rule": "INCLUDE" +} +``` + diff --git a/legacy/doc/models/customer-creation-source.md b/legacy/doc/models/customer-creation-source.md new file mode 100644 index 000000000..8a4997f53 --- /dev/null +++ b/legacy/doc/models/customer-creation-source.md @@ -0,0 +1,33 @@ + +# Customer Creation Source + +Indicates the method used to create the customer profile. + +## Enumeration + +`CustomerCreationSource` + +## Fields + +| Name | Description | +| --- | --- | +| `OTHER` | The default creation source. This source is typically used for backward/future
compatibility when the original source of a customer profile is
unrecognized. For example, when older clients do not support newer
source types. | +| `APPOINTMENTS` | The customer profile was created automatically when an appointment
was scheduled. | +| `COUPON` | The customer profile was created automatically when a coupon was issued
using Square Point of Sale. | +| `DELETION_RECOVERY` | The customer profile was restored through Square's deletion recovery
process. | +| `DIRECTORY` | The customer profile was created manually through Square Seller Dashboard or the
Point of Sale application. | +| `EGIFTING` | The customer profile was created automatically when a gift card was
issued using Square Point of Sale. Customer profiles are created for
both the buyer and the recipient of the gift card. | +| `EMAIL_COLLECTION` | The customer profile was created through Square Point of Sale when
signing up for marketing emails during checkout. | +| `FEEDBACK` | The customer profile was created automatically when providing feedback
through a digital receipt. | +| `IMPORT` | The customer profile was created automatically when importing customer
data through Square Seller Dashboard. | +| `INVOICES` | The customer profile was created automatically during an invoice payment. | +| `LOYALTY` | The customer profile was created automatically when customers provide a
phone number for loyalty reward programs during checkout. | +| `MARKETING` | The customer profile was created as the result of a campaign managed
through Square’s Facebook integration. | +| `MERGE` | The customer profile was created as the result of explicitly merging
multiple customer profiles through the Square Seller Dashboard or the Point of
Sale application. | +| `ONLINE_STORE` | The customer profile was created through Square's Online Store solution
(legacy service). | +| `INSTANT_PROFILE` | The customer profile was created automatically as the result of a successful
transaction that did not explicitly link to an existing customer profile. | +| `TERMINAL` | The customer profile was created through Square's Virtual Terminal. | +| `THIRD_PARTY` | The customer profile was created through a Square API call. | +| `THIRD_PARTY_IMPORT` | The customer profile was created by a third-party product and imported
through an official integration. | +| `UNMERGE_RECOVERY` | The customer profile was restored through Square's unmerge recovery
process. | + diff --git a/legacy/doc/models/customer-custom-attribute-filter-value.md b/legacy/doc/models/customer-custom-attribute-filter-value.md new file mode 100644 index 000000000..51859c885 --- /dev/null +++ b/legacy/doc/models/customer-custom-attribute-filter-value.md @@ -0,0 +1,58 @@ + +# Customer Custom Attribute Filter Value + +A type-specific filter used in a [custom attribute filter](../../doc/models/customer-custom-attribute-filter.md) to search based on the value +of a customer-related [custom attribute](../../doc/models/custom-attribute.md). + +## Structure + +`CustomerCustomAttributeFilterValue` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `email` | [`CustomerTextFilter \| undefined`](../../doc/models/customer-text-filter.md) | Optional | 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. | +| `phone` | [`CustomerTextFilter \| undefined`](../../doc/models/customer-text-filter.md) | Optional | 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. | +| `text` | [`CustomerTextFilter \| undefined`](../../doc/models/customer-text-filter.md) | Optional | 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. | +| `selection` | [`FilterValue \| undefined`](../../doc/models/filter-value.md) | Optional | 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. | +| `date` | [`TimeRange \| undefined`](../../doc/models/time-range.md) | Optional | 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. | +| `number` | [`FloatNumberRange \| undefined`](../../doc/models/float-number-range.md) | Optional | Specifies a decimal number range. | +| `mBoolean` | `boolean \| null \| undefined` | Optional | A filter for a query based on the value of a `Boolean`-type custom attribute. | +| `address` | [`CustomerAddressFilter \| undefined`](../../doc/models/customer-address-filter.md) | Optional | The customer address filter. This filter is used in a [CustomerCustomAttributeFilterValue](../../doc/models/customer-custom-attribute-filter-value.md) filter when
searching by an `Address`-type custom attribute. | + +## Example (as JSON) + +```json +{ + "email": { + "exact": "exact6", + "fuzzy": "fuzzy2" + }, + "phone": { + "exact": "exact0", + "fuzzy": "fuzzy6" + }, + "text": { + "exact": "exact0", + "fuzzy": "fuzzy6" + }, + "selection": { + "all": [ + "all1" + ], + "any": [ + "any8", + "any9" + ], + "none": [ + "none3" + ] + }, + "date": { + "start_at": "start_at6", + "end_at": "end_at6" + } +} +``` + diff --git a/legacy/doc/models/customer-custom-attribute-filter.md b/legacy/doc/models/customer-custom-attribute-filter.md new file mode 100644 index 000000000..b4d968dfb --- /dev/null +++ b/legacy/doc/models/customer-custom-attribute-filter.md @@ -0,0 +1,60 @@ + +# Customer Custom Attribute Filter + +The custom attribute filter. Use this filter in a set of [custom attribute filters](../../doc/models/customer-custom-attribute-filters.md) to search +based on the value or last updated date of a customer-related [custom attribute](../../doc/models/custom-attribute.md). + +## Structure + +`CustomerCustomAttributeFilter` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `key` | `string` | Required | 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` | [`CustomerCustomAttributeFilterValue \| undefined`](../../doc/models/customer-custom-attribute-filter-value.md) | Optional | A type-specific filter used in a [custom attribute filter](../../doc/models/customer-custom-attribute-filter.md) to search based on the value
of a customer-related [custom attribute](../../doc/models/custom-attribute.md). | +| `updatedAt` | [`TimeRange \| undefined`](../../doc/models/time-range.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "key": "key6", + "filter": { + "email": { + "exact": "exact6", + "fuzzy": "fuzzy2" + }, + "phone": { + "exact": "exact0", + "fuzzy": "fuzzy6" + }, + "text": { + "exact": "exact0", + "fuzzy": "fuzzy6" + }, + "selection": { + "all": [ + "all1" + ], + "any": [ + "any8", + "any9" + ], + "none": [ + "none3" + ] + }, + "date": { + "start_at": "start_at6", + "end_at": "end_at6" + } + }, + "updated_at": { + "start_at": "start_at6", + "end_at": "end_at6" + } +} +``` + diff --git a/legacy/doc/models/customer-custom-attribute-filters.md b/legacy/doc/models/customer-custom-attribute-filters.md new file mode 100644 index 000000000..0dfc95656 --- /dev/null +++ b/legacy/doc/models/customer-custom-attribute-filters.md @@ -0,0 +1,63 @@ + +# Customer Custom Attribute Filters + +The custom attribute filters in a set of [customer filters](../../doc/models/customer-filter.md) used in a search query. Use this filter +to search based on [custom attributes](../../doc/models/custom-attribute.md) 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). + +## Structure + +`CustomerCustomAttributeFilters` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `filters` | [`CustomerCustomAttributeFilter[] \| null \| undefined`](../../doc/models/customer-custom-attribute-filter.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "filters": [ + { + "key": "key0", + "filter": { + "email": { + "exact": "exact6", + "fuzzy": "fuzzy2" + }, + "phone": { + "exact": "exact0", + "fuzzy": "fuzzy6" + }, + "text": { + "exact": "exact0", + "fuzzy": "fuzzy6" + }, + "selection": { + "all": [ + "all1" + ], + "any": [ + "any8", + "any9" + ], + "none": [ + "none3" + ] + }, + "date": { + "start_at": "start_at6", + "end_at": "end_at6" + } + }, + "updated_at": { + "start_at": "start_at6", + "end_at": "end_at6" + } + } + ] +} +``` + diff --git a/legacy/doc/models/customer-details.md b/legacy/doc/models/customer-details.md new file mode 100644 index 000000000..4e8a07f20 --- /dev/null +++ b/legacy/doc/models/customer-details.md @@ -0,0 +1,25 @@ + +# Customer Details + +Details about the customer making the payment. + +## Structure + +`CustomerDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customerInitiated` | `boolean \| null \| undefined` | Optional | Indicates whether the customer initiated the payment. | +| `sellerKeyedIn` | `boolean \| null \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "customer_initiated": false, + "seller_keyed_in": false +} +``` + diff --git a/legacy/doc/models/customer-filter.md b/legacy/doc/models/customer-filter.md new file mode 100644 index 000000000..dd0a691b5 --- /dev/null +++ b/legacy/doc/models/customer-filter.md @@ -0,0 +1,55 @@ + +# Customer Filter + +Represents the filtering criteria in a [search query](../../doc/models/customer-query.md) that defines how to filter +customer profiles returned in [SearchCustomers](../../doc/api/customers.md#search-customers) results. + +## Structure + +`CustomerFilter` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `creationSource` | [`CustomerCreationSourceFilter \| undefined`](../../doc/models/customer-creation-source-filter.md) | Optional | 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. | +| `createdAt` | [`TimeRange \| undefined`](../../doc/models/time-range.md) | Optional | 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. | +| `updatedAt` | [`TimeRange \| undefined`](../../doc/models/time-range.md) | Optional | 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. | +| `emailAddress` | [`CustomerTextFilter \| undefined`](../../doc/models/customer-text-filter.md) | Optional | 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. | +| `phoneNumber` | [`CustomerTextFilter \| undefined`](../../doc/models/customer-text-filter.md) | Optional | 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. | +| `referenceId` | [`CustomerTextFilter \| undefined`](../../doc/models/customer-text-filter.md) | Optional | 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. | +| `groupIds` | [`FilterValue \| undefined`](../../doc/models/filter-value.md) | Optional | 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. | +| `customAttribute` | [`CustomerCustomAttributeFilters \| undefined`](../../doc/models/customer-custom-attribute-filters.md) | Optional | The custom attribute filters in a set of [customer filters](../../doc/models/customer-filter.md) used in a search query. Use this filter
to search based on [custom attributes](../../doc/models/custom-attribute.md) 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). | +| `segmentIds` | [`FilterValue \| undefined`](../../doc/models/filter-value.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "creation_source": { + "values": [ + "THIRD_PARTY_IMPORT", + "THIRD_PARTY", + "TERMINAL" + ], + "rule": "INCLUDE" + }, + "created_at": { + "start_at": "start_at4", + "end_at": "end_at8" + }, + "updated_at": { + "start_at": "start_at6", + "end_at": "end_at6" + }, + "email_address": { + "exact": "exact2", + "fuzzy": "fuzzy8" + }, + "phone_number": { + "exact": "exact2", + "fuzzy": "fuzzy8" + } +} +``` + diff --git a/legacy/doc/models/customer-group.md b/legacy/doc/models/customer-group.md new file mode 100644 index 000000000..af164cc14 --- /dev/null +++ b/legacy/doc/models/customer-group.md @@ -0,0 +1,32 @@ + +# Customer Group + +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. + +## Structure + +`CustomerGroup` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | A unique Square-generated ID for the customer group.
**Constraints**: *Maximum Length*: `255` | +| `name` | `string` | Required | The name of the customer group. | +| `createdAt` | `string \| undefined` | Optional | The timestamp when the customer group was created, in RFC 3339 format. | +| `updatedAt` | `string \| undefined` | Optional | The timestamp when the customer group was last updated, in RFC 3339 format. | + +## Example (as JSON) + +```json +{ + "id": "id0", + "name": "name0", + "created_at": "created_at8", + "updated_at": "updated_at6" +} +``` + diff --git a/legacy/doc/models/customer-inclusion-exclusion.md b/legacy/doc/models/customer-inclusion-exclusion.md new file mode 100644 index 000000000..037c202ce --- /dev/null +++ b/legacy/doc/models/customer-inclusion-exclusion.md @@ -0,0 +1,17 @@ + +# Customer Inclusion Exclusion + +Indicates whether customers should be included in, or excluded from, +the result set when they match the filtering criteria. + +## Enumeration + +`CustomerInclusionExclusion` + +## Fields + +| Name | Description | +| --- | --- | +| `INCLUDE` | Customers should be included in the result set when they match the
filtering criteria. | +| `EXCLUDE` | Customers should be excluded from the result set when they match
the filtering criteria. | + diff --git a/legacy/doc/models/customer-preferences.md b/legacy/doc/models/customer-preferences.md new file mode 100644 index 000000000..6ba15e690 --- /dev/null +++ b/legacy/doc/models/customer-preferences.md @@ -0,0 +1,23 @@ + +# Customer Preferences + +Represents communication preferences for the customer profile. + +## Structure + +`CustomerPreferences` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `emailUnsubscribed` | `boolean \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "email_unsubscribed": false +} +``` + diff --git a/legacy/doc/models/customer-query.md b/legacy/doc/models/customer-query.md new file mode 100644 index 000000000..34ba40730 --- /dev/null +++ b/legacy/doc/models/customer-query.md @@ -0,0 +1,53 @@ + +# Customer Query + +Represents filtering and sorting criteria for a [SearchCustomers](../../doc/api/customers.md#search-customers) request. + +## Structure + +`CustomerQuery` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `filter` | [`CustomerFilter \| undefined`](../../doc/models/customer-filter.md) | Optional | Represents the filtering criteria in a [search query](../../doc/models/customer-query.md) that defines how to filter
customer profiles returned in [SearchCustomers](../../doc/api/customers.md#search-customers) results. | +| `sort` | [`CustomerSort \| undefined`](../../doc/models/customer-sort.md) | Optional | Represents the sorting criteria in a [search query](../../doc/models/customer-query.md) that defines how to sort
customer profiles returned in [SearchCustomers](../../doc/api/customers.md#search-customers) results. | + +## Example (as JSON) + +```json +{ + "filter": { + "creation_source": { + "values": [ + "THIRD_PARTY_IMPORT", + "THIRD_PARTY", + "TERMINAL" + ], + "rule": "INCLUDE" + }, + "created_at": { + "start_at": "start_at4", + "end_at": "end_at8" + }, + "updated_at": { + "start_at": "start_at6", + "end_at": "end_at6" + }, + "email_address": { + "exact": "exact2", + "fuzzy": "fuzzy8" + }, + "phone_number": { + "exact": "exact2", + "fuzzy": "fuzzy8" + } + }, + "sort": { + "field": "DEFAULT", + "order": "DESC" + } +} +``` + diff --git a/legacy/doc/models/customer-segment.md b/legacy/doc/models/customer-segment.md new file mode 100644 index 000000000..ddfa75168 --- /dev/null +++ b/legacy/doc/models/customer-segment.md @@ -0,0 +1,32 @@ + +# Customer Segment + +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. + +## Structure + +`CustomerSegment` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | A unique Square-generated ID for the segment.
**Constraints**: *Maximum Length*: `255` | +| `name` | `string` | Required | The name of the segment. | +| `createdAt` | `string \| undefined` | Optional | The timestamp when the segment was created, in RFC 3339 format. | +| `updatedAt` | `string \| undefined` | Optional | The timestamp when the segment was last updated, in RFC 3339 format. | + +## Example (as JSON) + +```json +{ + "id": "id0", + "name": "name0", + "created_at": "created_at8", + "updated_at": "updated_at6" +} +``` + diff --git a/legacy/doc/models/customer-sort-field.md b/legacy/doc/models/customer-sort-field.md new file mode 100644 index 000000000..7052f404d --- /dev/null +++ b/legacy/doc/models/customer-sort-field.md @@ -0,0 +1,16 @@ + +# Customer Sort Field + +Specifies customer attributes as the sort key to customer profiles returned from a search. + +## Enumeration + +`CustomerSortField` + +## Fields + +| Name | Description | +| --- | --- | +| `DEFAULT` | Use the default sort key. By default, customers are sorted
alphanumerically by concatenating their `given_name` and `family_name`. If
neither name field is set, string comparison is performed using one of the
remaining fields in the following order: `company_name`, `email`,
`phone_number`. | +| `CREATED_AT` | Use the creation date attribute (`created_at`) of customer profiles as the sort key. | + diff --git a/legacy/doc/models/customer-sort.md b/legacy/doc/models/customer-sort.md new file mode 100644 index 000000000..4139db24e --- /dev/null +++ b/legacy/doc/models/customer-sort.md @@ -0,0 +1,26 @@ + +# Customer Sort + +Represents the sorting criteria in a [search query](../../doc/models/customer-query.md) that defines how to sort +customer profiles returned in [SearchCustomers](../../doc/api/customers.md#search-customers) results. + +## Structure + +`CustomerSort` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `field` | [`string \| undefined`](../../doc/models/customer-sort-field.md) | Optional | Specifies customer attributes as the sort key to customer profiles returned from a search. | +| `order` | [`string \| undefined`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | + +## Example (as JSON) + +```json +{ + "field": "DEFAULT", + "order": "DESC" +} +``` + diff --git a/legacy/doc/models/customer-tax-ids.md b/legacy/doc/models/customer-tax-ids.md new file mode 100644 index 000000000..2bc2c2544 --- /dev/null +++ b/legacy/doc/models/customer-tax-ids.md @@ -0,0 +1,24 @@ + +# Customer Tax Ids + +Represents the tax ID associated with a [customer profile](../../doc/models/customer.md). 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). + +## Structure + +`CustomerTaxIds` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `euVat` | `string \| null \| undefined` | Optional | The EU VAT identification number for the customer. For example, `IE3426675K`. The ID can contain alphanumeric characters only.
**Constraints**: *Maximum Length*: `20` | + +## Example (as JSON) + +```json +{ + "eu_vat": "eu_vat6" +} +``` + diff --git a/legacy/doc/models/customer-text-filter.md b/legacy/doc/models/customer-text-filter.md new file mode 100644 index 000000000..007c22a41 --- /dev/null +++ b/legacy/doc/models/customer-text-filter.md @@ -0,0 +1,27 @@ + +# Customer Text Filter + +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. + +## Structure + +`CustomerTextFilter` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `exact` | `string \| null \| undefined` | Optional | Use the exact filter to select customers whose attributes match exactly the specified query. | +| `fuzzy` | `string \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "exact": "exact4", + "fuzzy": "fuzzy0" +} +``` + diff --git a/legacy/doc/models/customer.md b/legacy/doc/models/customer.md new file mode 100644 index 000000000..a85e6ea1f --- /dev/null +++ b/legacy/doc/models/customer.md @@ -0,0 +1,54 @@ + +# Customer + +Represents a Square customer profile in the Customer Directory of a Square seller. + +## Structure + +`Customer` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | 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. | +| `createdAt` | `string \| undefined` | Optional | The timestamp when the customer profile was created, in RFC 3339 format. | +| `updatedAt` | `string \| undefined` | Optional | The timestamp when the customer profile was last updated, in RFC 3339 format. | +| `cards` | [`Card[] \| null \| undefined`](../../doc/models/card.md) | Optional | Payment details of the credit, debit, and gift cards stored on file for the customer profile.

DEPRECATED at version 2021-06-16 and will be RETIRED at version 2024-12-18. Replaced by calling [ListCards](api-endpoint:Cards-ListCards) (for credit and debit cards on file)
or [ListGiftCards](api-endpoint:GiftCards-ListGiftCards) (for gift cards on file) and including the `customer_id` query parameter.
For more information, see [Migration notes](https://developer.squareup.com/docs/customers-api/what-it-does#migrate-customer-cards). | +| `givenName` | `string \| null \| undefined` | Optional | The given name (that is, the first name) associated with the customer profile. | +| `familyName` | `string \| null \| undefined` | Optional | The family name (that is, the last name) associated with the customer profile. | +| `nickname` | `string \| null \| undefined` | Optional | A nickname for the customer profile. | +| `companyName` | `string \| null \| undefined` | Optional | A business name associated with the customer profile. | +| `emailAddress` | `string \| null \| undefined` | Optional | The email address associated with the customer profile. | +| `address` | [`Address \| undefined`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | +| `phoneNumber` | `string \| null \| undefined` | Optional | The phone number associated with the customer profile. | +| `birthday` | `string \| null \| undefined` | Optional | 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). | +| `referenceId` | `string \| null \| undefined` | Optional | An optional second ID used to associate the customer profile with an
entity in another system. | +| `note` | `string \| null \| undefined` | Optional | A custom note associated with the customer profile. | +| `preferences` | [`CustomerPreferences \| undefined`](../../doc/models/customer-preferences.md) | Optional | Represents communication preferences for the customer profile. | +| `creationSource` | [`string \| undefined`](../../doc/models/customer-creation-source.md) | Optional | Indicates the method used to create the customer profile. | +| `groupIds` | `string[] \| null \| undefined` | Optional | The IDs of [customer groups](entity:CustomerGroup) the customer belongs to. | +| `segmentIds` | `string[] \| null \| undefined` | Optional | The IDs of [customer segments](entity:CustomerSegment) the customer belongs to. | +| `version` | `bigint \| undefined` | Optional | The Square-assigned version number of the customer profile. The version number is incremented each time an update is committed to the customer profile, except for changes to customer segment membership and cards on file. | +| `taxIds` | [`CustomerTaxIds \| undefined`](../../doc/models/customer-tax-ids.md) | Optional | Represents the tax ID associated with a [customer profile](../../doc/models/customer.md). 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). | + +## Example (as JSON) + +```json +{ + "id": "id8", + "created_at": "created_at6", + "updated_at": "updated_at6", + "cards": [ + { + "id": "id8", + "card_brand": "DISCOVER", + "last_4": "last_40", + "exp_month": 152, + "exp_year": 144 + } + ], + "given_name": "given_name0" +} +``` + diff --git a/legacy/doc/models/data-collection-options-input-type.md b/legacy/doc/models/data-collection-options-input-type.md new file mode 100644 index 000000000..083724f8c --- /dev/null +++ b/legacy/doc/models/data-collection-options-input-type.md @@ -0,0 +1,16 @@ + +# Data Collection Options Input Type + +Describes the input type of the data. + +## Enumeration + +`DataCollectionOptionsInputType` + +## Fields + +| Name | Description | +| --- | --- | +| `EMAIL` | This value is used to represent an input text that contains a email validation on the
client. | +| `PHONE_NUMBER` | This value is used to represent an input text that contains a phone number validation on
the client. | + diff --git a/legacy/doc/models/data-collection-options.md b/legacy/doc/models/data-collection-options.md new file mode 100644 index 000000000..dd683b10b --- /dev/null +++ b/legacy/doc/models/data-collection-options.md @@ -0,0 +1,29 @@ + +# Data Collection Options + +## Structure + +`DataCollectionOptions` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `title` | `string` | Required | The title text to display in the data collection flow on the Terminal.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `250` | +| `body` | `string` | Required | The body text to display under the title in the data collection screen flow on the
Terminal.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `10000` | +| `inputType` | [`string`](../../doc/models/data-collection-options-input-type.md) | Required | Describes the input type of the data. | +| `collectedData` | [`CollectedData \| undefined`](../../doc/models/collected-data.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "title": "title4", + "body": "body4", + "input_type": "EMAIL", + "collected_data": { + "input_text": "input_text0" + } +} +``` + diff --git a/legacy/doc/models/date-range.md b/legacy/doc/models/date-range.md new file mode 100644 index 000000000..23a59f4b5 --- /dev/null +++ b/legacy/doc/models/date-range.md @@ -0,0 +1,26 @@ + +# Date Range + +A range defined by two dates. Used for filtering a query for Connect v2 +objects that have date properties. + +## Structure + +`DateRange` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `startDate` | `string \| null \| undefined` | Optional | 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). | +| `endDate` | `string \| null \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "start_date": "start_date0", + "end_date": "end_date6" +} +``` + diff --git a/legacy/doc/models/day-of-week.md b/legacy/doc/models/day-of-week.md new file mode 100644 index 000000000..2ce16311e --- /dev/null +++ b/legacy/doc/models/day-of-week.md @@ -0,0 +1,21 @@ + +# Day of Week + +Indicates the specific day of the week. + +## Enumeration + +`DayOfWeek` + +## Fields + +| Name | Description | +| --- | --- | +| `SUN` | Sunday | +| `MON` | Monday | +| `TUE` | Tuesday | +| `WED` | Wednesday | +| `THU` | Thursday | +| `FRI` | Friday | +| `SAT` | Saturday | + diff --git a/legacy/doc/models/delete-booking-custom-attribute-definition-response.md b/legacy/doc/models/delete-booking-custom-attribute-definition-response.md new file mode 100644 index 000000000..87968c598 --- /dev/null +++ b/legacy/doc/models/delete-booking-custom-attribute-definition-response.md @@ -0,0 +1,24 @@ + +# Delete Booking Custom Attribute Definition Response + +Represents a [DeleteBookingCustomAttributeDefinition](../../doc/api/booking-custom-attributes.md#delete-booking-custom-attribute-definition) response +containing error messages when errors occurred during the request. The successful response does not contain any payload. + +## Structure + +`DeleteBookingCustomAttributeDefinitionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "errors": [] +} +``` + diff --git a/legacy/doc/models/delete-booking-custom-attribute-response.md b/legacy/doc/models/delete-booking-custom-attribute-response.md new file mode 100644 index 000000000..011bf4ec1 --- /dev/null +++ b/legacy/doc/models/delete-booking-custom-attribute-response.md @@ -0,0 +1,24 @@ + +# Delete Booking Custom Attribute Response + +Represents a [DeleteBookingCustomAttribute](../../doc/api/booking-custom-attributes.md#delete-booking-custom-attribute) response. +Either an empty object `{}` (for a successful deletion) or `errors` is present in the response. + +## Structure + +`DeleteBookingCustomAttributeResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "errors": [] +} +``` + diff --git a/legacy/doc/models/delete-break-type-response.md b/legacy/doc/models/delete-break-type-response.md new file mode 100644 index 000000000..dcc745f8c --- /dev/null +++ b/legacy/doc/models/delete-break-type-response.md @@ -0,0 +1,31 @@ + +# Delete Break Type Response + +The response to a request to delete a `BreakType`. The response might contain a set +of `Error` objects if the request resulted in errors. + +## Structure + +`DeleteBreakTypeResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/delete-catalog-object-response.md b/legacy/doc/models/delete-catalog-object-response.md new file mode 100644 index 000000000..fcfa42190 --- /dev/null +++ b/legacy/doc/models/delete-catalog-object-response.md @@ -0,0 +1,35 @@ + +# Delete Catalog Object Response + +## Structure + +`DeleteCatalogObjectResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `deletedObjectIds` | `string[] \| undefined` | Optional | 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. | +| `deletedAt` | `string \| undefined` | Optional | 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 (as JSON) + +```json +{ + "deleted_at": "2016-11-16T22:25:24.878Z", + "deleted_object_ids": [ + "7SB3ZQYJ5GDMVFL7JK46JCHT", + "KQLFFHA6K6J3YQAQAWDQAL57" + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/delete-customer-card-response.md b/legacy/doc/models/delete-customer-card-response.md new file mode 100644 index 000000000..60711c324 --- /dev/null +++ b/legacy/doc/models/delete-customer-card-response.md @@ -0,0 +1,37 @@ + +# Delete Customer Card Response + +Defines the fields that are included in the response body of +a request to the `DeleteCustomerCard` endpoint. + +## Structure + +`DeleteCustomerCardResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/delete-customer-custom-attribute-definition-response.md b/legacy/doc/models/delete-customer-custom-attribute-definition-response.md new file mode 100644 index 000000000..fde7bb47a --- /dev/null +++ b/legacy/doc/models/delete-customer-custom-attribute-definition-response.md @@ -0,0 +1,36 @@ + +# Delete Customer Custom Attribute Definition Response + +Represents a response from a delete request containing error messages if there are any. + +## Structure + +`DeleteCustomerCustomAttributeDefinitionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/delete-customer-custom-attribute-response.md b/legacy/doc/models/delete-customer-custom-attribute-response.md new file mode 100644 index 000000000..d88094899 --- /dev/null +++ b/legacy/doc/models/delete-customer-custom-attribute-response.md @@ -0,0 +1,43 @@ + +# Delete Customer Custom Attribute Response + +Represents a [DeleteCustomerCustomAttribute](../../doc/api/customer-custom-attributes.md#delete-customer-custom-attribute) response. +Either an empty object `{}` (for a successful deletion) or `errors` is present in the response. + +## Structure + +`DeleteCustomerCustomAttributeResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/delete-customer-group-response.md b/legacy/doc/models/delete-customer-group-response.md new file mode 100644 index 000000000..4b46d95c9 --- /dev/null +++ b/legacy/doc/models/delete-customer-group-response.md @@ -0,0 +1,43 @@ + +# Delete Customer Group Response + +Defines the fields that are included in the response body of +a request to the [DeleteCustomerGroup](../../doc/api/customer-groups.md#delete-customer-group) endpoint. + +## Structure + +`DeleteCustomerGroupResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/delete-customer-request.md b/legacy/doc/models/delete-customer-request.md new file mode 100644 index 000000000..4649ccd31 --- /dev/null +++ b/legacy/doc/models/delete-customer-request.md @@ -0,0 +1,24 @@ + +# Delete Customer Request + +Defines the fields that are included in a request to the `DeleteCustomer` +endpoint. + +## Structure + +`DeleteCustomerRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `version` | `bigint \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "version": 222 +} +``` + diff --git a/legacy/doc/models/delete-customer-response.md b/legacy/doc/models/delete-customer-response.md new file mode 100644 index 000000000..22ee9fcc7 --- /dev/null +++ b/legacy/doc/models/delete-customer-response.md @@ -0,0 +1,31 @@ + +# Delete Customer Response + +Defines the fields that are included in the response body of +a request to the `DeleteCustomer` endpoint. + +## Structure + +`DeleteCustomerResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/delete-dispute-evidence-response.md b/legacy/doc/models/delete-dispute-evidence-response.md new file mode 100644 index 000000000..aed3c07c2 --- /dev/null +++ b/legacy/doc/models/delete-dispute-evidence-response.md @@ -0,0 +1,42 @@ + +# Delete Dispute Evidence Response + +Defines the fields in a `DeleteDisputeEvidence` response. + +## Structure + +`DeleteDisputeEvidenceResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/delete-invoice-attachment-response.md b/legacy/doc/models/delete-invoice-attachment-response.md new file mode 100644 index 000000000..0e244b900 --- /dev/null +++ b/legacy/doc/models/delete-invoice-attachment-response.md @@ -0,0 +1,36 @@ + +# Delete Invoice Attachment Response + +Represents a [DeleteInvoiceAttachment](../../doc/api/invoices.md#delete-invoice-attachment) response. + +## Structure + +`DeleteInvoiceAttachmentResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/delete-invoice-request.md b/legacy/doc/models/delete-invoice-request.md new file mode 100644 index 000000000..e3d2c22e5 --- /dev/null +++ b/legacy/doc/models/delete-invoice-request.md @@ -0,0 +1,23 @@ + +# Delete Invoice Request + +Describes a `DeleteInvoice` request. + +## Structure + +`DeleteInvoiceRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `version` | `number \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "version": 26 +} +``` + diff --git a/legacy/doc/models/delete-invoice-response.md b/legacy/doc/models/delete-invoice-response.md new file mode 100644 index 000000000..ddae17e14 --- /dev/null +++ b/legacy/doc/models/delete-invoice-response.md @@ -0,0 +1,36 @@ + +# Delete Invoice Response + +Describes a `DeleteInvoice` response. + +## Structure + +`DeleteInvoiceResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/delete-location-custom-attribute-definition-response.md b/legacy/doc/models/delete-location-custom-attribute-definition-response.md new file mode 100644 index 000000000..fd7a36cbb --- /dev/null +++ b/legacy/doc/models/delete-location-custom-attribute-definition-response.md @@ -0,0 +1,42 @@ + +# Delete Location Custom Attribute Definition Response + +Represents a response from a delete request containing error messages if there are any. + +## Structure + +`DeleteLocationCustomAttributeDefinitionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/delete-location-custom-attribute-response.md b/legacy/doc/models/delete-location-custom-attribute-response.md new file mode 100644 index 000000000..0decffcea --- /dev/null +++ b/legacy/doc/models/delete-location-custom-attribute-response.md @@ -0,0 +1,37 @@ + +# Delete Location Custom Attribute Response + +Represents a [DeleteLocationCustomAttribute](../../doc/api/location-custom-attributes.md#delete-location-custom-attribute) response. +Either an empty object `{}` (for a successful deletion) or `errors` is present in the response. + +## Structure + +`DeleteLocationCustomAttributeResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/delete-loyalty-reward-response.md b/legacy/doc/models/delete-loyalty-reward-response.md new file mode 100644 index 000000000..5bddf0fb3 --- /dev/null +++ b/legacy/doc/models/delete-loyalty-reward-response.md @@ -0,0 +1,42 @@ + +# Delete Loyalty Reward Response + +A response returned by the API call. + +## Structure + +`DeleteLoyaltyRewardResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/delete-merchant-custom-attribute-definition-response.md b/legacy/doc/models/delete-merchant-custom-attribute-definition-response.md new file mode 100644 index 000000000..dece480de --- /dev/null +++ b/legacy/doc/models/delete-merchant-custom-attribute-definition-response.md @@ -0,0 +1,36 @@ + +# Delete Merchant Custom Attribute Definition Response + +Represents a response from a delete request containing error messages if there are any. + +## Structure + +`DeleteMerchantCustomAttributeDefinitionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/delete-merchant-custom-attribute-response.md b/legacy/doc/models/delete-merchant-custom-attribute-response.md new file mode 100644 index 000000000..1aec4e683 --- /dev/null +++ b/legacy/doc/models/delete-merchant-custom-attribute-response.md @@ -0,0 +1,37 @@ + +# Delete Merchant Custom Attribute Response + +Represents a [DeleteMerchantCustomAttribute](../../doc/api/merchant-custom-attributes.md#delete-merchant-custom-attribute) response. +Either an empty object `{}` (for a successful deletion) or `errors` is present in the response. + +## Structure + +`DeleteMerchantCustomAttributeResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/delete-order-custom-attribute-definition-response.md b/legacy/doc/models/delete-order-custom-attribute-definition-response.md new file mode 100644 index 000000000..c7e39e5e1 --- /dev/null +++ b/legacy/doc/models/delete-order-custom-attribute-definition-response.md @@ -0,0 +1,30 @@ + +# Delete Order Custom Attribute Definition Response + +Represents a response from deleting an order custom attribute definition. + +## Structure + +`DeleteOrderCustomAttributeDefinitionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/delete-order-custom-attribute-response.md b/legacy/doc/models/delete-order-custom-attribute-response.md new file mode 100644 index 000000000..0d2f6b78e --- /dev/null +++ b/legacy/doc/models/delete-order-custom-attribute-response.md @@ -0,0 +1,30 @@ + +# Delete Order Custom Attribute Response + +Represents a response from deleting an order custom attribute. + +## Structure + +`DeleteOrderCustomAttributeResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/delete-payment-link-response.md b/legacy/doc/models/delete-payment-link-response.md new file mode 100644 index 000000000..5aaf2c858 --- /dev/null +++ b/legacy/doc/models/delete-payment-link-response.md @@ -0,0 +1,32 @@ + +# Delete Payment Link Response + +## Structure + +`DeletePaymentLinkResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | - | +| `id` | `string \| undefined` | Optional | The ID of the link that is deleted. | +| `cancelledOrderId` | `string \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "cancelled_order_id": "asx8LgZ6MRzD0fObfkJ6obBmSh4F", + "id": "MQASNYL6QB6DFCJ3", + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/delete-shift-response.md b/legacy/doc/models/delete-shift-response.md new file mode 100644 index 000000000..526c8d3b0 --- /dev/null +++ b/legacy/doc/models/delete-shift-response.md @@ -0,0 +1,31 @@ + +# Delete Shift Response + +The response to a request to delete a `Shift`. The response might contain a set of +`Error` objects if the request resulted in errors. + +## Structure + +`DeleteShiftResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/delete-snippet-response.md b/legacy/doc/models/delete-snippet-response.md new file mode 100644 index 000000000..a29ed939e --- /dev/null +++ b/legacy/doc/models/delete-snippet-response.md @@ -0,0 +1,42 @@ + +# Delete Snippet Response + +Represents a `DeleteSnippet` response. + +## Structure + +`DeleteSnippetResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/delete-subscription-action-response.md b/legacy/doc/models/delete-subscription-action-response.md new file mode 100644 index 000000000..75a13b0a6 --- /dev/null +++ b/legacy/doc/models/delete-subscription-action-response.md @@ -0,0 +1,62 @@ + +# Delete Subscription Action Response + +Defines output parameters in a response of the [DeleteSubscriptionAction](../../doc/api/subscriptions.md#delete-subscription-action) +endpoint. + +## Structure + +`DeleteSubscriptionActionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Errors encountered during the request. | +| `subscription` | [`Subscription \| undefined`](../../doc/models/subscription.md) | Optional | Represents a subscription purchased by a customer.

For more information, see
[Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). | + +## Example (as JSON) + +```json +{ + "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" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/delete-webhook-subscription-response.md b/legacy/doc/models/delete-webhook-subscription-response.md new file mode 100644 index 000000000..bd21a6455 --- /dev/null +++ b/legacy/doc/models/delete-webhook-subscription-response.md @@ -0,0 +1,31 @@ + +# Delete Webhook Subscription Response + +Defines the fields that are included in the response body of +a request to the [DeleteWebhookSubscription](../../doc/api/webhook-subscriptions.md#delete-webhook-subscription) endpoint. + +## Structure + +`DeleteWebhookSubscriptionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/deprecated-create-dispute-evidence-file-request.md b/legacy/doc/models/deprecated-create-dispute-evidence-file-request.md new file mode 100644 index 000000000..fc2dd1f57 --- /dev/null +++ b/legacy/doc/models/deprecated-create-dispute-evidence-file-request.md @@ -0,0 +1,27 @@ + +# Deprecated Create Dispute Evidence File Request + +Defines the parameters for a `DeprecatedCreateDisputeEvidenceFile` request. + +## Structure + +`DeprecatedCreateDisputeEvidenceFileRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string` | Required | The Unique ID. For more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `45` | +| `evidenceType` | [`string \| undefined`](../../doc/models/dispute-evidence-type.md) | Optional | The type of the dispute evidence. | +| `contentType` | `string \| null \| undefined` | Optional | The MIME type of the uploaded file.
The type can be image/heic, image/heif, image/jpeg, application/pdf, image/png, or image/tiff.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | + +## Example (as JSON) + +```json +{ + "idempotency_key": "idempotency_key4", + "evidence_type": "ONLINE_OR_APP_ACCESS_LOG", + "content_type": "content_type2" +} +``` + diff --git a/legacy/doc/models/deprecated-create-dispute-evidence-file-response.md b/legacy/doc/models/deprecated-create-dispute-evidence-file-response.md new file mode 100644 index 000000000..059d22ea5 --- /dev/null +++ b/legacy/doc/models/deprecated-create-dispute-evidence-file-response.md @@ -0,0 +1,43 @@ + +# Deprecated Create Dispute Evidence File Response + +Defines the fields in a `DeprecatedCreateDisputeEvidenceFile` response. + +## Structure + +`DeprecatedCreateDisputeEvidenceFileResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `evidence` | [`DisputeEvidence \| undefined`](../../doc/models/dispute-evidence.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "evidence": { + "dispute_id": "bVTprrwk0gygTLZ96VX1oB", + "evidence_file": { + "filename": "evidence.tiff", + "filetype": "image/tiff" + }, + "evidence_id": "TOomLInj6iWmP3N8qfCXrB", + "evidence_type": "GENERIC_EVIDENCE", + "uploaded_at": "2018-10-18T16:01:10.000Z", + "id": "id2", + "evidence_text": "evidence_text6" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/deprecated-create-dispute-evidence-text-request.md b/legacy/doc/models/deprecated-create-dispute-evidence-text-request.md new file mode 100644 index 000000000..70a3a4815 --- /dev/null +++ b/legacy/doc/models/deprecated-create-dispute-evidence-text-request.md @@ -0,0 +1,27 @@ + +# Deprecated Create Dispute Evidence Text Request + +Defines the parameters for a `DeprecatedCreateDisputeEvidenceText` request. + +## Structure + +`DeprecatedCreateDisputeEvidenceTextRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string` | Required | The Unique ID. For more information, see [Idempotency](https://developer.squareup.com/docs/working-with-apis/idempotency).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `45` | +| `evidenceType` | [`string \| undefined`](../../doc/models/dispute-evidence-type.md) | Optional | The type of the dispute evidence. | +| `evidenceText` | `string` | Required | The evidence string.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `500` | + +## Example (as JSON) + +```json +{ + "evidence_text": "1Z8888888888888888", + "evidence_type": "TRACKING_NUMBER", + "idempotency_key": "ed3ee3933d946f1514d505d173c82648" +} +``` + diff --git a/legacy/doc/models/deprecated-create-dispute-evidence-text-response.md b/legacy/doc/models/deprecated-create-dispute-evidence-text-response.md new file mode 100644 index 000000000..118b34219 --- /dev/null +++ b/legacy/doc/models/deprecated-create-dispute-evidence-text-response.md @@ -0,0 +1,43 @@ + +# Deprecated Create Dispute Evidence Text Response + +Defines the fields in a `DeprecatedCreateDisputeEvidenceText` response. + +## Structure + +`DeprecatedCreateDisputeEvidenceTextResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `evidence` | [`DisputeEvidence \| undefined`](../../doc/models/dispute-evidence.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "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", + "evidence_id": "evidence_id0", + "evidence_file": { + "filename": "filename8", + "filetype": "filetype8" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/destination-details-card-refund-details.md b/legacy/doc/models/destination-details-card-refund-details.md new file mode 100644 index 000000000..de52a9142 --- /dev/null +++ b/legacy/doc/models/destination-details-card-refund-details.md @@ -0,0 +1,31 @@ + +# Destination Details Card Refund Details + +## Structure + +`DestinationDetailsCardRefundDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `card` | [`Card \| undefined`](../../doc/models/card.md) | Optional | 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. | +| `entryMethod` | `string \| null \| undefined` | Optional | The method used to enter the card's details for the refund. The method can be
`KEYED`, `SWIPED`, `EMV`, `ON_FILE`, or `CONTACTLESS`.
**Constraints**: *Maximum Length*: `50` | +| `authResultCode` | `string \| null \| undefined` | Optional | The authorization code provided by the issuer when a refund is approved.
**Constraints**: *Maximum Length*: `10` | + +## Example (as JSON) + +```json +{ + "card": { + "id": "id6", + "card_brand": "OTHER_BRAND", + "last_4": "last_48", + "exp_month": 228, + "exp_year": 68 + }, + "entry_method": "entry_method4", + "auth_result_code": "auth_result_code6" +} +``` + diff --git a/legacy/doc/models/destination-details-cash-refund-details.md b/legacy/doc/models/destination-details-cash-refund-details.md new file mode 100644 index 000000000..3d0899025 --- /dev/null +++ b/legacy/doc/models/destination-details-cash-refund-details.md @@ -0,0 +1,31 @@ + +# Destination Details Cash Refund Details + +Stores details about a cash refund. Contains only non-confidential information. + +## Structure + +`DestinationDetailsCashRefundDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `sellerSuppliedMoney` | [`Money`](../../doc/models/money.md) | Required | 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. | +| `changeBackMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "seller_supplied_money": { + "amount": 36, + "currency": "MKD" + }, + "change_back_money": { + "amount": 78, + "currency": "XBD" + } +} +``` + diff --git a/legacy/doc/models/destination-details-external-refund-details.md b/legacy/doc/models/destination-details-external-refund-details.md new file mode 100644 index 000000000..88a80610d --- /dev/null +++ b/legacy/doc/models/destination-details-external-refund-details.md @@ -0,0 +1,27 @@ + +# Destination Details External Refund Details + +Stores details about an external refund. Contains only non-confidential information. + +## Structure + +`DestinationDetailsExternalRefundDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `type` | `string` | Required | 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.
**Constraints**: *Maximum Length*: `50` | +| `source` | `string` | Required | A description of the external refund source. For example,
"Food Delivery Service".
**Constraints**: *Maximum Length*: `255` | +| `sourceId` | `string \| null \| undefined` | Optional | An ID to associate the refund to its originating source.
**Constraints**: *Maximum Length*: `255` | + +## Example (as JSON) + +```json +{ + "type": "type4", + "source": "source2", + "source_id": "source_id0" +} +``` + diff --git a/legacy/doc/models/destination-details.md b/legacy/doc/models/destination-details.md new file mode 100644 index 000000000..5bf5ed97f --- /dev/null +++ b/legacy/doc/models/destination-details.md @@ -0,0 +1,50 @@ + +# Destination Details + +Details about a refund's destination. + +## Structure + +`DestinationDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `cardDetails` | [`DestinationDetailsCardRefundDetails \| undefined`](../../doc/models/destination-details-card-refund-details.md) | Optional | - | +| `cashDetails` | [`DestinationDetailsCashRefundDetails \| undefined`](../../doc/models/destination-details-cash-refund-details.md) | Optional | Stores details about a cash refund. Contains only non-confidential information. | +| `externalDetails` | [`DestinationDetailsExternalRefundDetails \| undefined`](../../doc/models/destination-details-external-refund-details.md) | Optional | Stores details about an external refund. Contains only non-confidential information. | + +## Example (as JSON) + +```json +{ + "card_details": { + "card": { + "id": "id6", + "card_brand": "OTHER_BRAND", + "last_4": "last_48", + "exp_month": 228, + "exp_year": 68 + }, + "entry_method": "entry_method8", + "auth_result_code": "auth_result_code0" + }, + "cash_details": { + "seller_supplied_money": { + "amount": 36, + "currency": "MKD" + }, + "change_back_money": { + "amount": 78, + "currency": "XBD" + } + }, + "external_details": { + "type": "type6", + "source": "source0", + "source_id": "source_id8" + } +} +``` + diff --git a/legacy/doc/models/destination-type.md b/legacy/doc/models/destination-type.md new file mode 100644 index 000000000..f1d7bddd1 --- /dev/null +++ b/legacy/doc/models/destination-type.md @@ -0,0 +1,18 @@ + +# Destination Type + +List of possible destinations against which a payout can be made. + +## Enumeration + +`DestinationType` + +## Fields + +| Name | Description | +| --- | --- | +| `BANK_ACCOUNT` | An external bank account outside of Square. | +| `CARD` | An external card outside of Square used for the transfer. | +| `SQUARE_BALANCE` | | +| `SQUARE_STORED_BALANCE` | Square Checking or Savings account (US), Square Card (CA) | + diff --git a/legacy/doc/models/destination.md b/legacy/doc/models/destination.md new file mode 100644 index 000000000..e4916e3ea --- /dev/null +++ b/legacy/doc/models/destination.md @@ -0,0 +1,25 @@ + +# Destination + +Information about the destination against which the payout was made. + +## Structure + +`Destination` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `type` | [`string \| undefined`](../../doc/models/destination-type.md) | Optional | List of possible destinations against which a payout can be made. | +| `id` | `string \| undefined` | Optional | Square issued unique ID (also known as the instrument ID) associated with this destination. | + +## Example (as JSON) + +```json +{ + "type": "SQUARE_BALANCE", + "id": "id6" +} +``` + diff --git a/legacy/doc/models/device-attributes-device-type.md b/legacy/doc/models/device-attributes-device-type.md new file mode 100644 index 000000000..19c965a27 --- /dev/null +++ b/legacy/doc/models/device-attributes-device-type.md @@ -0,0 +1,15 @@ + +# Device Attributes Device Type + +An enum identifier of the device type. + +## Enumeration + +`DeviceAttributesDeviceType` + +## Fields + +| Name | +| --- | +| `TERMINAL` | + diff --git a/legacy/doc/models/device-attributes.md b/legacy/doc/models/device-attributes.md new file mode 100644 index 000000000..bf98cd298 --- /dev/null +++ b/legacy/doc/models/device-attributes.md @@ -0,0 +1,34 @@ + +# Device Attributes + +## Structure + +`DeviceAttributes` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `type` | `string` | Required, Constant | An enum identifier of the device type.
**Default**: `'TERMINAL'` | +| `manufacturer` | `string` | Required | The maker of the device. | +| `model` | `string \| null \| undefined` | Optional | The specific model of the device. | +| `name` | `string \| null \| undefined` | Optional | A seller-specified name for the device. | +| `manufacturersId` | `string \| null \| undefined` | Optional | The manufacturer-supplied identifier for the device (where available). In many cases,
this identifier will be a serial number. | +| `updatedAt` | `string \| undefined` | Optional | The RFC 3339-formatted value of the most recent update to the device information.
(Could represent any field update on the device.) | +| `version` | `string \| undefined` | Optional | The current version of software installed on the device. | +| `merchantToken` | `string \| null \| undefined` | Optional | The merchant_token identifying the merchant controlling the device. | + +## Example (as JSON) + +```json +{ + "type": "TERMINAL", + "manufacturer": "manufacturer0", + "model": "model4", + "name": "name6", + "manufacturers_id": "manufacturers_id2", + "updated_at": "updated_at2", + "version": "version2" +} +``` + diff --git a/legacy/doc/models/device-checkout-options.md b/legacy/doc/models/device-checkout-options.md new file mode 100644 index 000000000..90db14233 --- /dev/null +++ b/legacy/doc/models/device-checkout-options.md @@ -0,0 +1,37 @@ + +# Device Checkout Options + +## Structure + +`DeviceCheckoutOptions` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `deviceId` | `string` | Required | 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. | +| `skipReceiptScreen` | `boolean \| null \| undefined` | Optional | Instructs the device to skip the receipt screen. Defaults to false. | +| `collectSignature` | `boolean \| null \| undefined` | Optional | Indicates that signature collection is desired during checkout. Defaults to false. | +| `tipSettings` | [`TipSettings \| undefined`](../../doc/models/tip-settings.md) | Optional | - | +| `showItemizedCart` | `boolean \| null \| undefined` | Optional | Show the itemization screen prior to taking a payment. This field is only meaningful when the
checkout includes an order ID. Defaults to true. | + +## Example (as JSON) + +```json +{ + "device_id": "device_id4", + "skip_receipt_screen": false, + "collect_signature": false, + "tip_settings": { + "allow_tipping": false, + "separate_tip_screen": false, + "custom_tip_field": false, + "tip_percentages": [ + 48 + ], + "smart_tipping": false + }, + "show_itemized_cart": false +} +``` + diff --git a/legacy/doc/models/device-code-status.md b/legacy/doc/models/device-code-status.md new file mode 100644 index 000000000..84f9da02f --- /dev/null +++ b/legacy/doc/models/device-code-status.md @@ -0,0 +1,18 @@ + +# Device Code Status + +DeviceCode.Status enum. + +## Enumeration + +`DeviceCodeStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `UNKNOWN` | The status cannot be determined or does not exist. | +| `UNPAIRED` | The device code is just created and unpaired. | +| `PAIRED` | The device code has been signed in and paired to a device. | +| `EXPIRED` | The device code was unpaired and expired before it was paired. | + diff --git a/legacy/doc/models/device-code.md b/legacy/doc/models/device-code.md new file mode 100644 index 000000000..0962891e8 --- /dev/null +++ b/legacy/doc/models/device-code.md @@ -0,0 +1,36 @@ + +# Device Code + +## Structure + +`DeviceCode` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | The unique id for this device code. | +| `name` | `string \| null \| undefined` | Optional | An optional user-defined name for the device code.
**Constraints**: *Maximum Length*: `128` | +| `code` | `string \| undefined` | Optional | The unique code that can be used to login. | +| `deviceId` | `string \| undefined` | Optional | The unique id of the device that used this code. Populated when the device is paired up. | +| `productType` | `string` | Required, Constant | **Default**: `'TERMINAL_API'` | +| `locationId` | `string \| null \| undefined` | Optional | The location assigned to this code.
**Constraints**: *Maximum Length*: `50` | +| `status` | [`string \| undefined`](../../doc/models/device-code-status.md) | Optional | DeviceCode.Status enum. | +| `pairBy` | `string \| undefined` | Optional | When this DeviceCode will expire and no longer login. Timestamp in RFC 3339 format. | +| `createdAt` | `string \| undefined` | Optional | When this DeviceCode was created. Timestamp in RFC 3339 format. | +| `statusChangedAt` | `string \| undefined` | Optional | When this DeviceCode's status was last changed. Timestamp in RFC 3339 format. | +| `pairedAt` | `string \| undefined` | Optional | When this DeviceCode was paired. Timestamp in RFC 3339 format. | + +## Example (as JSON) + +```json +{ + "product_type": "TERMINAL_API", + "id": "id4", + "name": "name4", + "code": "code2", + "device_id": "device_id0", + "location_id": "location_id8" +} +``` + diff --git a/legacy/doc/models/device-component-details-application-details.md b/legacy/doc/models/device-component-details-application-details.md new file mode 100644 index 000000000..c4b355e0d --- /dev/null +++ b/legacy/doc/models/device-component-details-application-details.md @@ -0,0 +1,27 @@ + +# Device Component Details Application Details + +## Structure + +`DeviceComponentDetailsApplicationDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `applicationType` | [`string \| undefined`](../../doc/models/application-type.md) | Optional | - | +| `version` | `string \| undefined` | Optional | The version of the application. | +| `sessionLocation` | `string \| null \| undefined` | Optional | The location_id of the session for the application. | +| `deviceCodeId` | `string \| null \| undefined` | Optional | The id of the device code that was used to log in to the device. | + +## Example (as JSON) + +```json +{ + "application_type": "TERMINAL_API", + "version": "version4", + "session_location": "session_location0", + "device_code_id": "device_code_id2" +} +``` + diff --git a/legacy/doc/models/device-component-details-battery-details.md b/legacy/doc/models/device-component-details-battery-details.md new file mode 100644 index 000000000..3a36412b9 --- /dev/null +++ b/legacy/doc/models/device-component-details-battery-details.md @@ -0,0 +1,23 @@ + +# Device Component Details Battery Details + +## Structure + +`DeviceComponentDetailsBatteryDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `visiblePercent` | `number \| null \| undefined` | Optional | The battery charge percentage as displayed on the device. | +| `externalPower` | [`string \| undefined`](../../doc/models/device-component-details-external-power.md) | Optional | An enum for ExternalPower. | + +## Example (as JSON) + +```json +{ + "visible_percent": 48, + "external_power": "AVAILABLE_CHARGING" +} +``` + diff --git a/legacy/doc/models/device-component-details-card-reader-details.md b/legacy/doc/models/device-component-details-card-reader-details.md new file mode 100644 index 000000000..738504723 --- /dev/null +++ b/legacy/doc/models/device-component-details-card-reader-details.md @@ -0,0 +1,21 @@ + +# Device Component Details Card Reader Details + +## Structure + +`DeviceComponentDetailsCardReaderDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `version` | `string \| undefined` | Optional | The version of the card reader. | + +## Example (as JSON) + +```json +{ + "version": "version8" +} +``` + diff --git a/legacy/doc/models/device-component-details-ethernet-details.md b/legacy/doc/models/device-component-details-ethernet-details.md new file mode 100644 index 000000000..145854a10 --- /dev/null +++ b/legacy/doc/models/device-component-details-ethernet-details.md @@ -0,0 +1,23 @@ + +# Device Component Details Ethernet Details + +## Structure + +`DeviceComponentDetailsEthernetDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `active` | `boolean \| null \| undefined` | Optional | A boolean to represent whether the Ethernet interface is currently active. | +| `ipAddressV4` | `string \| null \| undefined` | Optional | The string representation of the device’s IPv4 address. | + +## Example (as JSON) + +```json +{ + "active": false, + "ip_address_v4": "ip_address_v46" +} +``` + diff --git a/legacy/doc/models/device-component-details-external-power.md b/legacy/doc/models/device-component-details-external-power.md new file mode 100644 index 000000000..713c92ae7 --- /dev/null +++ b/legacy/doc/models/device-component-details-external-power.md @@ -0,0 +1,18 @@ + +# Device Component Details External Power + +An enum for ExternalPower. + +## Enumeration + +`DeviceComponentDetailsExternalPower` + +## Fields + +| Name | Description | +| --- | --- | +| `AVAILABLE_CHARGING` | Plugged in and charging. | +| `AVAILABLE_NOT_IN_USE` | Fully charged. | +| `UNAVAILABLE` | On battery power. | +| `AVAILABLE_INSUFFICIENT` | Not providing enough power for the device. | + diff --git a/legacy/doc/models/device-component-details-measurement.md b/legacy/doc/models/device-component-details-measurement.md new file mode 100644 index 000000000..506fc64f9 --- /dev/null +++ b/legacy/doc/models/device-component-details-measurement.md @@ -0,0 +1,23 @@ + +# Device Component Details Measurement + +A value qualified by unit of measure. + +## Structure + +`DeviceComponentDetailsMeasurement` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `value` | `number \| null \| undefined` | Optional | - | + +## Example (as JSON) + +```json +{ + "value": 132 +} +``` + diff --git a/legacy/doc/models/device-component-details-network-interface-details.md b/legacy/doc/models/device-component-details-network-interface-details.md new file mode 100644 index 000000000..931ceb7bd --- /dev/null +++ b/legacy/doc/models/device-component-details-network-interface-details.md @@ -0,0 +1,21 @@ + +# Device Component Details Network Interface Details + +## Structure + +`DeviceComponentDetailsNetworkInterfaceDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ipAddressV4` | `string \| null \| undefined` | Optional | The string representation of the device’s IPv4 address. | + +## Example (as JSON) + +```json +{ + "ip_address_v4": "ip_address_v46" +} +``` + diff --git a/legacy/doc/models/device-component-details-wi-fi-details.md b/legacy/doc/models/device-component-details-wi-fi-details.md new file mode 100644 index 000000000..2dfc0e48e --- /dev/null +++ b/legacy/doc/models/device-component-details-wi-fi-details.md @@ -0,0 +1,31 @@ + +# Device Component Details Wi Fi Details + +## Structure + +`DeviceComponentDetailsWiFiDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `active` | `boolean \| null \| undefined` | Optional | A boolean to represent whether the WiFI interface is currently active. | +| `ssid` | `string \| null \| undefined` | Optional | The name of the connected WIFI network. | +| `ipAddressV4` | `string \| null \| undefined` | Optional | The string representation of the device’s IPv4 address. | +| `secureConnection` | `string \| null \| undefined` | Optional | The security protocol for a secure connection (e.g. WPA2). None provided if the connection
is unsecured. | +| `signalStrength` | [`DeviceComponentDetailsMeasurement \| undefined`](../../doc/models/device-component-details-measurement.md) | Optional | A value qualified by unit of measure. | + +## Example (as JSON) + +```json +{ + "active": false, + "ssid": "ssid6", + "ip_address_v4": "ip_address_v40", + "secure_connection": "secure_connection6", + "signal_strength": { + "value": 222 + } +} +``` + diff --git a/legacy/doc/models/device-details.md b/legacy/doc/models/device-details.md new file mode 100644 index 000000000..214bfce34 --- /dev/null +++ b/legacy/doc/models/device-details.md @@ -0,0 +1,27 @@ + +# Device Details + +Details about the device that took the payment. + +## Structure + +`DeviceDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `deviceId` | `string \| null \| undefined` | Optional | The Square-issued ID of the device.
**Constraints**: *Maximum Length*: `255` | +| `deviceInstallationId` | `string \| null \| undefined` | Optional | The Square-issued installation ID for the device.
**Constraints**: *Maximum Length*: `255` | +| `deviceName` | `string \| null \| undefined` | Optional | The name of the device set by the seller.
**Constraints**: *Maximum Length*: `255` | + +## Example (as JSON) + +```json +{ + "device_id": "device_id0", + "device_installation_id": "device_installation_id2", + "device_name": "device_name2" +} +``` + diff --git a/legacy/doc/models/device-metadata.md b/legacy/doc/models/device-metadata.md new file mode 100644 index 000000000..16e6088a1 --- /dev/null +++ b/legacy/doc/models/device-metadata.md @@ -0,0 +1,36 @@ + +# Device Metadata + +## Structure + +`DeviceMetadata` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `batteryPercentage` | `string \| null \| undefined` | Optional | The Terminal’s remaining battery percentage, between 1-100. | +| `chargingState` | `string \| null \| undefined` | Optional | The current charging state of the Terminal.
Options: `CHARGING`, `NOT_CHARGING` | +| `locationId` | `string \| null \| undefined` | Optional | The ID of the Square seller business location associated with the Terminal. | +| `merchantId` | `string \| null \| undefined` | Optional | The ID of the Square merchant account that is currently signed-in to the Terminal. | +| `networkConnectionType` | `string \| null \| undefined` | Optional | The Terminal’s current network connection type.
Options: `WIFI`, `ETHERNET` | +| `paymentRegion` | `string \| null \| undefined` | Optional | The country in which the Terminal is authorized to take payments. | +| `serialNumber` | `string \| null \| undefined` | Optional | The unique identifier assigned to the Terminal, which can be found on the lower back
of the device. | +| `osVersion` | `string \| null \| undefined` | Optional | The current version of the Terminal’s operating system. | +| `appVersion` | `string \| null \| undefined` | Optional | The current version of the application running on the Terminal. | +| `wifiNetworkName` | `string \| null \| undefined` | Optional | The name of the Wi-Fi network to which the Terminal is connected. | +| `wifiNetworkStrength` | `string \| null \| undefined` | Optional | The signal strength of the Wi-FI network connection.
Options: `POOR`, `FAIR`, `GOOD`, `EXCELLENT` | +| `ipAddress` | `string \| null \| undefined` | Optional | The IP address of the Terminal. | + +## Example (as JSON) + +```json +{ + "battery_percentage": "battery_percentage4", + "charging_state": "charging_state6", + "location_id": "location_id2", + "merchant_id": "merchant_id8", + "network_connection_type": "network_connection_type8" +} +``` + diff --git a/legacy/doc/models/device-status-category.md b/legacy/doc/models/device-status-category.md new file mode 100644 index 000000000..96ca1c676 --- /dev/null +++ b/legacy/doc/models/device-status-category.md @@ -0,0 +1,15 @@ + +# Device Status Category + +## Enumeration + +`DeviceStatusCategory` + +## Fields + +| Name | +| --- | +| `AVAILABLE` | +| `NEEDS_ATTENTION` | +| `OFFLINE` | + diff --git a/legacy/doc/models/device-status.md b/legacy/doc/models/device-status.md new file mode 100644 index 000000000..da420284f --- /dev/null +++ b/legacy/doc/models/device-status.md @@ -0,0 +1,21 @@ + +# Device Status + +## Structure + +`DeviceStatus` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `category` | [`string \| undefined`](../../doc/models/device-status-category.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "category": "NEEDS_ATTENTION" +} +``` + diff --git a/legacy/doc/models/device.md b/legacy/doc/models/device.md new file mode 100644 index 000000000..9fd32ae75 --- /dev/null +++ b/legacy/doc/models/device.md @@ -0,0 +1,125 @@ + +# Device + +## Structure + +`Device` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | A synthetic identifier for the device. The identifier includes a standardized prefix and
is otherwise an opaque id generated from key device fields. | +| `attributes` | [`DeviceAttributes`](../../doc/models/device-attributes.md) | Required | - | +| `components` | [`Component[] \| null \| undefined`](../../doc/models/component.md) | Optional | A list of components applicable to the device. | +| `status` | [`DeviceStatus \| undefined`](../../doc/models/device-status.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "attributes": { + "type": "TERMINAL", + "manufacturer": "manufacturer2", + "model": "model2", + "name": "name4", + "manufacturers_id": "manufacturers_id0", + "updated_at": "updated_at0", + "version": "version0" + }, + "id": "id0", + "components": [ + { + "type": "BATTERY", + "application_details": { + "application_type": "TERMINAL_API", + "version": "version4", + "session_location": "session_location0", + "device_code_id": "device_code_id2" + }, + "card_reader_details": { + "version": "version0" + }, + "battery_details": { + "visible_percent": 108, + "external_power": "AVAILABLE_CHARGING" + }, + "wifi_details": { + "active": false, + "ssid": "ssid8", + "ip_address_v4": "ip_address_v42", + "secure_connection": "secure_connection8", + "signal_strength": { + "value": 222 + } + }, + "ethernet_details": { + "active": false, + "ip_address_v4": "ip_address_v42" + } + }, + { + "type": "BATTERY", + "application_details": { + "application_type": "TERMINAL_API", + "version": "version4", + "session_location": "session_location0", + "device_code_id": "device_code_id2" + }, + "card_reader_details": { + "version": "version0" + }, + "battery_details": { + "visible_percent": 108, + "external_power": "AVAILABLE_CHARGING" + }, + "wifi_details": { + "active": false, + "ssid": "ssid8", + "ip_address_v4": "ip_address_v42", + "secure_connection": "secure_connection8", + "signal_strength": { + "value": 222 + } + }, + "ethernet_details": { + "active": false, + "ip_address_v4": "ip_address_v42" + } + }, + { + "type": "BATTERY", + "application_details": { + "application_type": "TERMINAL_API", + "version": "version4", + "session_location": "session_location0", + "device_code_id": "device_code_id2" + }, + "card_reader_details": { + "version": "version0" + }, + "battery_details": { + "visible_percent": 108, + "external_power": "AVAILABLE_CHARGING" + }, + "wifi_details": { + "active": false, + "ssid": "ssid8", + "ip_address_v4": "ip_address_v42", + "secure_connection": "secure_connection8", + "signal_strength": { + "value": 222 + } + }, + "ethernet_details": { + "active": false, + "ip_address_v4": "ip_address_v42" + } + } + ], + "status": { + "category": "AVAILABLE" + } +} +``` + diff --git a/legacy/doc/models/digital-wallet-details.md b/legacy/doc/models/digital-wallet-details.md new file mode 100644 index 000000000..25d0fd8a5 --- /dev/null +++ b/legacy/doc/models/digital-wallet-details.md @@ -0,0 +1,31 @@ + +# Digital Wallet Details + +Additional details about `WALLET` type payments. Contains only non-confidential information. + +## Structure + +`DigitalWalletDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `status` | `string \| null \| undefined` | Optional | The status of the `WALLET` payment. The status can be `AUTHORIZED`, `CAPTURED`, `VOIDED`, or
`FAILED`.
**Constraints**: *Maximum Length*: `50` | +| `brand` | `string \| null \| undefined` | Optional | 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`.
**Constraints**: *Maximum Length*: `50` | +| `cashAppDetails` | [`CashAppDetails \| undefined`](../../doc/models/cash-app-details.md) | Optional | Additional details about `WALLET` type payments with the `brand` of `CASH_APP`. | + +## Example (as JSON) + +```json +{ + "status": "status4", + "brand": "brand8", + "cash_app_details": { + "buyer_full_name": "buyer_full_name2", + "buyer_country_code": "buyer_country_code8", + "buyer_cashtag": "buyer_cashtag4" + } +} +``` + diff --git a/legacy/doc/models/disable-card-response.md b/legacy/doc/models/disable-card-response.md new file mode 100644 index 000000000..a74d0a81b --- /dev/null +++ b/legacy/doc/models/disable-card-response.md @@ -0,0 +1,66 @@ + +# Disable Card Response + +Defines the fields that are included in the response body of +a request to the [DisableCard](../../doc/api/cards.md#disable-card) endpoint. + +Note: if there are errors processing the request, the card field will not be +present. + +## Structure + +`DisableCardResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | +| `card` | [`Card \| undefined`](../../doc/models/card.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "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", + "id": "ccof:uIbfJXhXETSP197M3GB", + "last_4": "1111", + "merchant_id": "6SSW7HV8K2ST5", + "prepaid_type": "NOT_PREPAID", + "reference_id": "user-id-1", + "version": 2 + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/disable-events-response.md b/legacy/doc/models/disable-events-response.md new file mode 100644 index 000000000..f7d962a6e --- /dev/null +++ b/legacy/doc/models/disable-events-response.md @@ -0,0 +1,40 @@ + +# Disable Events Response + +Defines the fields that are included in the response body of +a request to the [DisableEvents](../../doc/api/events.md#disable-events) endpoint. + +Note: if there are errors processing the request, the events field will not be +present. + +## Structure + +`DisableEventsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/dismiss-terminal-action-response.md b/legacy/doc/models/dismiss-terminal-action-response.md new file mode 100644 index 000000000..67a95fe08 --- /dev/null +++ b/legacy/doc/models/dismiss-terminal-action-response.md @@ -0,0 +1,63 @@ + +# Dismiss Terminal Action Response + +## Structure + +`DismissTerminalActionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | +| `action` | [`TerminalAction \| undefined`](../../doc/models/terminal-action.md) | Optional | Represents an action processed by the Square Terminal. | + +## Example (as JSON) + +```json +{ + "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", + "cancel_reason": "TIMED_OUT" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/dismiss-terminal-checkout-response.md b/legacy/doc/models/dismiss-terminal-checkout-response.md new file mode 100644 index 000000000..c853f39ab --- /dev/null +++ b/legacy/doc/models/dismiss-terminal-checkout-response.md @@ -0,0 +1,76 @@ + +# Dismiss Terminal Checkout Response + +## Structure + +`DismissTerminalCheckoutResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | +| `checkout` | [`TerminalCheckout \| undefined`](../../doc/models/terminal-checkout.md) | Optional | Represents a checkout processed by the Square Terminal. | + +## Example (as JSON) + +```json +{ + "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, + "tip_percentages": [ + 48 + ], + "smart_tipping": false + }, + "show_itemized_cart": false + }, + "id": "LmZEKbo3SBfqO", + "location_id": "LOCATION_ID", + "payment_ids": [ + "D7vLJqMkvSoAlX4yyFzUitOy4EPZY" + ], + "payment_options": { + "autocomplete": true, + "delay_duration": "delay_duration2", + "accept_partial_authorization": false, + "delay_action": "CANCEL" + }, + "payment_type": "CARD_PRESENT", + "status": "COMPLETED", + "updated_at": "2023-11-29T15:00:18.936Z", + "reference_id": "reference_id0", + "note": "note8", + "order_id": "order_id6" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/dismiss-terminal-refund-response.md b/legacy/doc/models/dismiss-terminal-refund-response.md new file mode 100644 index 000000000..db6f6c6c1 --- /dev/null +++ b/legacy/doc/models/dismiss-terminal-refund-response.md @@ -0,0 +1,92 @@ + +# Dismiss Terminal Refund Response + +## Structure + +`DismissTerminalRefundResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | +| `refund` | [`TerminalRefund \| undefined`](../../doc/models/terminal-refund.md) | Optional | Represents a payment refund processed by the Square Terminal. Only supports Interac (Canadian debit network) payment refunds. | + +## Example (as JSON) + +```json +{ + "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", + "refund_id": "refund_id2" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/dispute-evidence-file.md b/legacy/doc/models/dispute-evidence-file.md new file mode 100644 index 000000000..8033157f6 --- /dev/null +++ b/legacy/doc/models/dispute-evidence-file.md @@ -0,0 +1,25 @@ + +# Dispute Evidence File + +A file to be uploaded as dispute evidence. + +## Structure + +`DisputeEvidenceFile` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `filename` | `string \| null \| undefined` | Optional | The file name including the file extension. For example: "receipt.tiff".
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | +| `filetype` | `string \| null \| undefined` | Optional | Dispute evidence files must be application/pdf, image/heic, image/heif, image/jpeg, image/png, or image/tiff formats.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | + +## Example (as JSON) + +```json +{ + "filename": "filename0", + "filetype": "filetype0" +} +``` + diff --git a/legacy/doc/models/dispute-evidence-type.md b/legacy/doc/models/dispute-evidence-type.md new file mode 100644 index 000000000..9808a2a3c --- /dev/null +++ b/legacy/doc/models/dispute-evidence-type.md @@ -0,0 +1,29 @@ + +# Dispute Evidence Type + +The type of the dispute evidence. + +## Enumeration + +`DisputeEvidenceType` + +## Fields + +| Name | Description | +| --- | --- | +| `GENERIC_EVIDENCE` | Square assumes this evidence type if you do not provide a type when uploading evidence.

Use when uploading evidence as a file or string. | +| `ONLINE_OR_APP_ACCESS_LOG` | Server or activity logs that show proof of the cardholder’s identity and that the
cardholder successfully ordered and received the goods (digitally or otherwise).
Example evidence includes IP addresses, corresponding timestamps/dates, cardholder’s name and email
address linked to a cardholder profile held by the seller, proof the same device and card (used
in dispute) were previously used in prior undisputed transaction, and any related detailed activity.

Use when uploading evidence as a file or string. | +| `AUTHORIZATION_DOCUMENTATION` | Evidence that the cardholder did provide authorization for the charge.
Example evidence includes a signed credit card authorization.

Use when uploading evidence as a file. | +| `CANCELLATION_OR_REFUND_DOCUMENTATION` | Evidence that the cardholder acknowledged your refund or cancellation policy.
Example evidence includes a signature or checkbox showing the cardholder’s acknowledgement of your
refund or cancellation policy.

Use when uploading evidence as a file or string. | +| `CARDHOLDER_COMMUNICATION` | Evidence that shows relevant communication with the cardholder.
Example evidence includes emails or texts that show the cardholder received goods/services or
demonstrate cardholder satisfaction.

Use when uploading evidence as a file. | +| `CARDHOLDER_INFORMATION` | Evidence that validates the customer's identity.
Example evidence includes personally identifiable details such as name, email address, purchaser IP
address, and a copy of the cardholder ID.

Use when uploading evidence as a file or string. | +| `PURCHASE_ACKNOWLEDGEMENT` | Evidence that shows proof of the sale/transaction.
Example evidence includes an invoice, contract, or other item showing the customer’s acknowledgement
of the purchase and your terms.

Use when uploading evidence as a file or string. | +| `DUPLICATE_CHARGE_DOCUMENTATION` | Evidence that shows the charges in question are valid and distinct from one another.
Example evidence includes receipts, shipping labels, and invoices along with their distinct payment IDs.

Use when uploading evidence as a file. | +| `PRODUCT_OR_SERVICE_DESCRIPTION` | A description of the product or service sold.

Use when uploading evidence as a file or string. | +| `RECEIPT` | A receipt or message sent to the cardholder detailing the charge.
Note: You do not need to upload the Square receipt; Square submits the receipt on your behalf.

Use when uploading evidence as a file or string. | +| `SERVICE_RECEIVED_DOCUMENTATION` | Evidence that the service was provided to the cardholder or the expected date that services will be rendered.
Example evidence includes a signed delivery form, work order, expected delivery date, or other written agreements.

Use when uploading evidence as a file or string. | +| `PROOF_OF_DELIVERY_DOCUMENTATION` | Evidence that shows the product was provided to the cardholder or the expected date of delivery.
Example evidence includes a signed delivery form or written agreement acknowledging receipt of the goods or services.

Use when uploading evidence as a file or string. | +| `RELATED_TRANSACTION_DOCUMENTATION` | Evidence that shows the cardholder previously processed transactions on the same card and did not dispute them.
Note: Square automatically provides up to five distinct Square receipts for related transactions, when available.

Use when uploading evidence as a file or string. | +| `REBUTTAL_EXPLANATION` | An explanation of why the cardholder’s claim is invalid.
Example evidence includes an explanation of why each distinct charge is a legitimate purchase, why the cardholder’s claim
for credit owed due to their attempt to cancel, return, or refund is invalid per your stated policy and cardholder
agreement, or an explanation of how the cardholder did not attempt to remedy the issue with you first to receive credit.

Use when uploading evidence as a file or string. | +| `TRACKING_NUMBER` | The tracking number for the order provided by the shipping carrier. If you have multiple numbers, they need to be
submitted individually as separate pieces of evidence.

Use when uploading evidence as a string. | + diff --git a/legacy/doc/models/dispute-evidence.md b/legacy/doc/models/dispute-evidence.md new file mode 100644 index 000000000..09d97f22f --- /dev/null +++ b/legacy/doc/models/dispute-evidence.md @@ -0,0 +1,34 @@ + +# Dispute Evidence + +## Structure + +`DisputeEvidence` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `evidenceId` | `string \| null \| undefined` | Optional | The Square-generated ID of the evidence.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | +| `id` | `string \| undefined` | Optional | The Square-generated ID of the evidence.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | +| `disputeId` | `string \| null \| undefined` | Optional | The ID of the dispute the evidence is associated with.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | +| `evidenceFile` | [`DisputeEvidenceFile \| undefined`](../../doc/models/dispute-evidence-file.md) | Optional | A file to be uploaded as dispute evidence. | +| `evidenceText` | `string \| null \| undefined` | Optional | Raw text
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `500` | +| `uploadedAt` | `string \| null \| undefined` | Optional | The time when the evidence was uploaded, in RFC 3339 format.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | +| `evidenceType` | [`string \| undefined`](../../doc/models/dispute-evidence-type.md) | Optional | The type of the dispute evidence. | + +## Example (as JSON) + +```json +{ + "evidence_id": "evidence_id0", + "id": "id2", + "dispute_id": "dispute_id4", + "evidence_file": { + "filename": "filename8", + "filetype": "filetype8" + }, + "evidence_text": "evidence_text6" +} +``` + diff --git a/legacy/doc/models/dispute-reason.md b/legacy/doc/models/dispute-reason.md new file mode 100644 index 000000000..b348da050 --- /dev/null +++ b/legacy/doc/models/dispute-reason.md @@ -0,0 +1,24 @@ + +# Dispute Reason + +The list of possible reasons why a cardholder might initiate a +dispute with their bank. + +## Enumeration + +`DisputeReason` + +## Fields + +| Name | Description | +| --- | --- | +| `AMOUNT_DIFFERS` | The cardholder claims that they were charged the wrong amount for the purchase.
To challenge this dispute, provide specific and concrete evidence that the cardholder agreed
to the amount charged. | +| `CANCELLED` | The cardholder claims that they attempted to return the goods or cancel the service.
To challenge this dispute, provide specific and concrete evidence to prove that the cardholder
is not due a refund and that the cardholder acknowledged your cancellation policy. | +| `DUPLICATE` | The cardholder claims that they were charged twice for the same purchase.
To challenge this dispute, provide specific and concrete evidence that shows both charges are
legitimate and independent of one another. | +| `NO_KNOWLEDGE` | The cardholder claims that they did not make this purchase nor authorized the charge.
To challenge this dispute, provide specific and concrete evidence that proves that the cardholder
identity was verified at the time of purchase and that the purchase was authorized. | +| `NOT_AS_DESCRIBED` | The cardholder claims the product or service was provided, but the quality of the deliverable
did not align with the expectations of the cardholder based on the description.
To challenge this dispute, provide specific and concrete evidence that shows the cardholder is in
possession of the product as described or received the service as described and agreed on. | +| `NOT_RECEIVED` | The cardholder claims the product or service was not received by the cardholder within the
stated time frame.
To challenge this dispute, provide specific and concrete evidence to prove that the cardholder is
in possession of or received the product or service sold. | +| `PAID_BY_OTHER_MEANS` | The cardholder claims that they previously paid for this purchase.
To challenge this dispute, provide specific and concrete evidence that shows both charges are
legitimate and independent of one another or proof that you already provided a credit for the charge. | +| `CUSTOMER_REQUESTS_CREDIT` | The cardholder claims that the purchase was canceled or returned, but they have not yet received
the credit.
To challenge this dispute, provide specific and concrete evidence to prove that the cardholder is not
due a refund and that they acknowledged your cancellation and/or refund policy. | +| `EMV_LIABILITY_SHIFT` | A chip-enabled card was not processed through a compliant chip-card reader (for example, it was swiped
instead of dipped into a chip-card reader).
You cannot challenge this dispute because the payment did not comply with EMV security requirements.
For more information, see [What Is EMV?](https://squareup.com/emv) | + diff --git a/legacy/doc/models/dispute-state.md b/legacy/doc/models/dispute-state.md new file mode 100644 index 000000000..d629040d0 --- /dev/null +++ b/legacy/doc/models/dispute-state.md @@ -0,0 +1,22 @@ + +# Dispute State + +The list of possible dispute states. + +## Enumeration + +`DisputeState` + +## Fields + +| Name | Description | +| --- | --- | +| `INQUIRY_EVIDENCE_REQUIRED` | The initial state of an inquiry with evidence required | +| `INQUIRY_PROCESSING` | Inquiry evidence has been submitted and the bank is processing the inquiry | +| `INQUIRY_CLOSED` | The inquiry is complete | +| `EVIDENCE_REQUIRED` | The initial state of a dispute with evidence required | +| `PROCESSING` | Dispute evidence has been submitted and the bank is processing the dispute | +| `WON` | The bank has completed processing the dispute and the seller has won | +| `LOST` | The bank has completed processing the dispute and the seller has lost | +| `ACCEPTED` | The seller has accepted the dispute | + diff --git a/legacy/doc/models/dispute.md b/legacy/doc/models/dispute.md new file mode 100644 index 000000000..4d30bc6ea --- /dev/null +++ b/legacy/doc/models/dispute.md @@ -0,0 +1,45 @@ + +# Dispute + +Represents a [dispute](https://developer.squareup.com/docs/disputes-api/overview) a cardholder initiated with their bank. + +## Structure + +`Dispute` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `disputeId` | `string \| null \| undefined` | Optional | The unique ID for this `Dispute`, generated by Square.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | +| `id` | `string \| undefined` | Optional | The unique ID for this `Dispute`, generated by Square.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | +| `amountMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `reason` | [`string \| undefined`](../../doc/models/dispute-reason.md) | Optional | The list of possible reasons why a cardholder might initiate a
dispute with their bank. | +| `state` | [`string \| undefined`](../../doc/models/dispute-state.md) | Optional | The list of possible dispute states. | +| `dueAt` | `string \| null \| undefined` | Optional | 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).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | +| `disputedPayment` | [`DisputedPayment \| undefined`](../../doc/models/disputed-payment.md) | Optional | The payment the cardholder disputed. | +| `evidenceIds` | `string[] \| null \| undefined` | Optional | The IDs of the evidence associated with the dispute. | +| `cardBrand` | [`string \| undefined`](../../doc/models/card-brand.md) | Optional | Indicates a card's brand, such as `VISA` or `MASTERCARD`. | +| `createdAt` | `string \| undefined` | Optional | The timestamp when the dispute was created, in RFC 3339 format.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | +| `updatedAt` | `string \| undefined` | Optional | The timestamp when the dispute was last updated, in RFC 3339 format.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | +| `brandDisputeId` | `string \| null \| undefined` | Optional | The ID of the dispute in the card brand system, generated by the card brand.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | +| `reportedDate` | `string \| null \| undefined` | Optional | The timestamp when the dispute was reported, in RFC 3339 format.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | +| `reportedAt` | `string \| null \| undefined` | Optional | The timestamp when the dispute was reported, in RFC 3339 format.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | +| `version` | `number \| undefined` | Optional | The current version of the `Dispute`. | +| `locationId` | `string \| null \| undefined` | Optional | The ID of the location where the dispute originated.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | + +## Example (as JSON) + +```json +{ + "dispute_id": "dispute_id2", + "id": "id0", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "reason": "NOT_AS_DESCRIBED", + "state": "LOST" +} +``` + diff --git a/legacy/doc/models/disputed-payment.md b/legacy/doc/models/disputed-payment.md new file mode 100644 index 000000000..00f8cef54 --- /dev/null +++ b/legacy/doc/models/disputed-payment.md @@ -0,0 +1,23 @@ + +# Disputed Payment + +The payment the cardholder disputed. + +## Structure + +`DisputedPayment` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `paymentId` | `string \| null \| undefined` | Optional | Square-generated unique ID of the payment being disputed.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `192` | + +## Example (as JSON) + +```json +{ + "payment_id": "payment_id8" +} +``` + diff --git a/legacy/doc/models/ecom-visibility.md b/legacy/doc/models/ecom-visibility.md new file mode 100644 index 000000000..17f245730 --- /dev/null +++ b/legacy/doc/models/ecom-visibility.md @@ -0,0 +1,18 @@ + +# Ecom Visibility + +Determines item visibility in Ecom (Online Store) and Online Checkout. + +## Enumeration + +`EcomVisibility` + +## Fields + +| Name | Description | +| --- | --- | +| `UNINDEXED` | Item is not synced with Ecom (Weebly). This is the default state | +| `UNAVAILABLE` | Item is synced but is unavailable within Ecom (Weebly) and Online Checkout | +| `HIDDEN` | Option for seller to choose manually created Quick Amounts. | +| `VISIBLE` | Item is synced but available within Ecom (Weebly) and Online Checkout but is hidden from Ecom Store. | + diff --git a/legacy/doc/models/employee-status.md b/legacy/doc/models/employee-status.md new file mode 100644 index 000000000..c56cca143 --- /dev/null +++ b/legacy/doc/models/employee-status.md @@ -0,0 +1,18 @@ + +# Employee Status + +The status of the Employee being retrieved. + +DEPRECATED at version 2020-08-26. Replaced by [TeamMemberStatus](entity:TeamMemberStatus). + +## Enumeration + +`EmployeeStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `ACTIVE` | Specifies that the employee is in the Active state. | +| `INACTIVE` | Specifies that the employee is in the Inactive state. | + diff --git a/legacy/doc/models/employee-wage.md b/legacy/doc/models/employee-wage.md new file mode 100644 index 000000000..c9371b340 --- /dev/null +++ b/legacy/doc/models/employee-wage.md @@ -0,0 +1,32 @@ + +# Employee Wage + +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). + +## Structure + +`EmployeeWage` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | The UUID for this object. | +| `employeeId` | `string \| null \| undefined` | Optional | The `Employee` that this wage is assigned to. | +| `title` | `string \| null \| undefined` | Optional | The job title that this wage relates to. | +| `hourlyRate` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "id": "id0", + "employee_id": "employee_id0", + "title": "title6", + "hourly_rate": { + "amount": 172, + "currency": "LAK" + } +} +``` + diff --git a/legacy/doc/models/employee.md b/legacy/doc/models/employee.md new file mode 100644 index 000000000..7d1338ab1 --- /dev/null +++ b/legacy/doc/models/employee.md @@ -0,0 +1,38 @@ + +# Employee + +An employee object that is used by the external API. + +DEPRECATED at version 2020-08-26. Replaced by [TeamMember](entity:TeamMember). + +## Structure + +`Employee` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | UUID for this object. | +| `firstName` | `string \| null \| undefined` | Optional | The employee's first name. | +| `lastName` | `string \| null \| undefined` | Optional | The employee's last name. | +| `email` | `string \| null \| undefined` | Optional | The employee's email address | +| `phoneNumber` | `string \| null \| undefined` | Optional | The employee's phone number in E.164 format, i.e. "+12125554250" | +| `locationIds` | `string[] \| null \| undefined` | Optional | A list of location IDs where this employee has access to. | +| `status` | [`string \| undefined`](../../doc/models/employee-status.md) | Optional | The status of the Employee being retrieved.

DEPRECATED at version 2020-08-26. Replaced by [TeamMemberStatus](entity:TeamMemberStatus). | +| `isOwner` | `boolean \| null \| undefined` | Optional | Whether this employee is the owner of the merchant. Each merchant
has one owner employee, and that employee has full authority over
the account. | +| `createdAt` | `string \| undefined` | Optional | A read-only timestamp in RFC 3339 format. | +| `updatedAt` | `string \| undefined` | Optional | A read-only timestamp in RFC 3339 format. | + +## Example (as JSON) + +```json +{ + "id": "id6", + "first_name": "first_name6", + "last_name": "last_name4", + "email": "email0", + "phone_number": "phone_number6" +} +``` + diff --git a/legacy/doc/models/enable-events-response.md b/legacy/doc/models/enable-events-response.md new file mode 100644 index 000000000..807c5425c --- /dev/null +++ b/legacy/doc/models/enable-events-response.md @@ -0,0 +1,34 @@ + +# Enable Events Response + +Defines the fields that are included in the response body of +a request to the [EnableEvents](../../doc/api/events.md#enable-events) endpoint. + +Note: if there are errors processing the request, the events field will not be +present. + +## Structure + +`EnableEventsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/error-category.md b/legacy/doc/models/error-category.md new file mode 100644 index 000000000..2fb6f113c --- /dev/null +++ b/legacy/doc/models/error-category.md @@ -0,0 +1,23 @@ + +# Error Category + +Indicates which high-level category of error has occurred during a +request to the Connect API. + +## Enumeration + +`ErrorCategory` + +## Fields + +| Name | Description | +| --- | --- | +| `API_ERROR` | An error occurred with the Connect API itself. | +| `AUTHENTICATION_ERROR` | An authentication error occurred. Most commonly, the request had
a missing, malformed, or otherwise invalid `Authorization` header. | +| `INVALID_REQUEST_ERROR` | The request was invalid. Most commonly, a required parameter was
missing, or a provided parameter had an invalid value. | +| `RATE_LIMIT_ERROR` | Your application reached the Square API rate limit. You might receive this error if your application sends a high number of requests
to Square APIs in a short period of time.

Your 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)
schedule 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. | +| `PAYMENT_METHOD_ERROR` | An error occurred while processing a payment method. Most commonly,
the details of the payment method were invalid (such as a card's CVV
or expiration date). | +| `REFUND_ERROR` | An error occurred while attempting to process a refund. | +| `MERCHANT_SUBSCRIPTION_ERROR` | An error occurred when checking a merchant subscription status | +| `EXTERNAL_VENDOR_ERROR` | An error that is returned from an external vendor's API | + diff --git a/legacy/doc/models/error-code.md b/legacy/doc/models/error-code.md new file mode 100644 index 000000000..328849313 --- /dev/null +++ b/legacy/doc/models/error-code.md @@ -0,0 +1,165 @@ + +# Error Code + +Indicates the specific error that occurred during a request to a +Square API. + +## Enumeration + +`ErrorCode` + +## Fields + +| Name | Description | +| --- | --- | +| `INTERNAL_SERVER_ERROR` | A general server error occurred. | +| `UNAUTHORIZED` | A general authorization error occurred. | +| `ACCESS_TOKEN_EXPIRED` | The provided access token has expired. | +| `ACCESS_TOKEN_REVOKED` | The provided access token has been revoked. | +| `CLIENT_DISABLED` | The provided client has been disabled. | +| `FORBIDDEN` | A general access error occurred. | +| `INSUFFICIENT_SCOPES` | The provided access token does not have permission
to execute the requested action. | +| `APPLICATION_DISABLED` | The calling application was disabled. | +| `V1_APPLICATION` | The calling application was created prior to
2016-03-30 and is not compatible with v2 Square API calls. | +| `V1_ACCESS_TOKEN` | The calling application is using an access token
created prior to 2016-03-30 and is not compatible with v2 Square API
calls. | +| `CARD_PROCESSING_NOT_ENABLED` | The location provided in the API call is not
enabled for credit card processing. | +| `MERCHANT_SUBSCRIPTION_NOT_FOUND` | A required subscription was not found for the merchant | +| `BAD_REQUEST` | A general error occurred with the request. | +| `MISSING_REQUIRED_PARAMETER` | The request is missing a required path, query, or
body parameter. | +| `INCORRECT_TYPE` | The value provided in the request is the wrong
type. For example, a string instead of an integer. | +| `INVALID_TIME` | Formatting for the provided time value is
incorrect. | +| `INVALID_TIME_RANGE` | The time range provided in the request is invalid.
For example, the end time is before the start time. | +| `INVALID_VALUE` | The provided value is invalid. For example,
including `%` in a phone number. | +| `INVALID_CURSOR` | The pagination cursor included in the request is
invalid. | +| `UNKNOWN_QUERY_PARAMETER` | The query parameters provided is invalid for the
requested endpoint. | +| `CONFLICTING_PARAMETERS` | One or more of the request parameters conflict with
each other. | +| `EXPECTED_JSON_BODY` | The request body is not a JSON object. | +| `INVALID_SORT_ORDER` | The provided sort order is not a valid key.
Currently, sort order must be `ASC` or `DESC`. | +| `VALUE_REGEX_MISMATCH` | The provided value does not match an expected
regular expression. | +| `VALUE_TOO_SHORT` | The provided string value is shorter than the
minimum length allowed. | +| `VALUE_TOO_LONG` | The provided string value is longer than the
maximum length allowed. | +| `VALUE_TOO_LOW` | The provided value is less than the supported
minimum. | +| `VALUE_TOO_HIGH` | The provided value is greater than the supported
maximum. | +| `VALUE_EMPTY` | The provided value has a default (empty) value
such as a blank string. | +| `ARRAY_LENGTH_TOO_LONG` | The provided array has too many elements. | +| `ARRAY_LENGTH_TOO_SHORT` | The provided array has too few elements. | +| `ARRAY_EMPTY` | The provided array is empty. | +| `EXPECTED_BOOLEAN` | The endpoint expected the provided value to be a
boolean. | +| `EXPECTED_INTEGER` | The endpoint expected the provided value to be an
integer. | +| `EXPECTED_FLOAT` | The endpoint expected the provided value to be a
float. | +| `EXPECTED_STRING` | The endpoint expected the provided value to be a
string. | +| `EXPECTED_OBJECT` | The endpoint expected the provided value to be a
JSON object. | +| `EXPECTED_ARRAY` | The endpoint expected the provided value to be an
array or list. | +| `EXPECTED_MAP` | The endpoint expected the provided value to be a
map or associative array. | +| `EXPECTED_BASE64_ENCODED_BYTE_ARRAY` | The endpoint expected the provided value to be an
array encoded in base64. | +| `INVALID_ARRAY_VALUE` | One or more objects in the array does not match the
array type. | +| `INVALID_ENUM_VALUE` | The provided static string is not valid for the
field. | +| `INVALID_CONTENT_TYPE` | Invalid content type header. | +| `INVALID_FORM_VALUE` | Only relevant for applications created prior to
2016-03-30. Indicates there was an error while parsing form values. | +| `CUSTOMER_NOT_FOUND` | The provided customer id can't be found in the merchant's customers list. | +| `ONE_INSTRUMENT_EXPECTED` | A general error occurred. | +| `NO_FIELDS_SET` | A general error occurred. | +| `TOO_MANY_MAP_ENTRIES` | Too many entries in the map field. | +| `MAP_KEY_LENGTH_TOO_SHORT` | The length of one of the provided keys in the map is too short. | +| `MAP_KEY_LENGTH_TOO_LONG` | The length of one of the provided keys in the map is too long. | +| `CUSTOMER_MISSING_NAME` | The provided customer does not have a recorded name. | +| `CUSTOMER_MISSING_EMAIL` | The provided customer does not have a recorded email. | +| `INVALID_PAUSE_LENGTH` | The subscription cannot be paused longer than the duration of the current phase. | +| `INVALID_DATE` | The subscription cannot be paused/resumed on the given date. | +| `UNSUPPORTED_COUNTRY` | The API request references an unsupported country. | +| `UNSUPPORTED_CURRENCY` | The API request references an unsupported currency. | +| `APPLE_TTP_PIN_TOKEN` | The payment was declined by the card issuer during an Apple Tap to Pay (TTP)
transaction with a request for the card's PIN. This code will be returned alongside
`CARD_DECLINED_VERIFICATION_REQUIRED` as a supplemental error, and will include an
issuer-provided token in the `details` field that is needed to initiate the PIN
collection flow on the iOS device. | +| `CARD_EXPIRED` | The card issuer declined the request because the card is expired. | +| `INVALID_EXPIRATION` | The expiration date for the payment card is invalid. For example,
it indicates a date in the past. | +| `INVALID_EXPIRATION_YEAR` | The expiration year for the payment card is invalid. For example,
it indicates a year in the past or contains invalid characters. | +| `INVALID_EXPIRATION_DATE` | The expiration date for the payment card is invalid. For example,
it contains invalid characters. | +| `UNSUPPORTED_CARD_BRAND` | The credit card provided is not from a supported issuer. | +| `UNSUPPORTED_ENTRY_METHOD` | The entry method for the credit card (swipe, dip, tap) is not supported. | +| `INVALID_ENCRYPTED_CARD` | The encrypted card information is invalid. | +| `INVALID_CARD` | The credit card cannot be validated based on the provided details. | +| `PAYMENT_AMOUNT_MISMATCH` | The payment was declined because there was a payment amount mismatch.
The money amount Square was expecting does not match the amount provided. | +| `GENERIC_DECLINE` | Square received a decline without any additional information.
If the payment information seems correct, the buyer can contact their
issuer to ask for more information. | +| `CVV_FAILURE` | The card issuer declined the request because the CVV value is invalid. | +| `ADDRESS_VERIFICATION_FAILURE` | The card issuer declined the request because the postal code is invalid. | +| `INVALID_ACCOUNT` | The issuer was not able to locate the account on record. | +| `CURRENCY_MISMATCH` | The currency associated with the payment is not valid for the provided
funding source. For example, a gift card funded in USD cannot be used to process
payments in GBP. | +| `INSUFFICIENT_FUNDS` | The funding source has insufficient funds to cover the payment. | +| `INSUFFICIENT_PERMISSIONS` | The Square account does not have the permissions to accept
this payment. For example, Square may limit which merchants are
allowed to receive gift card payments. | +| `CARDHOLDER_INSUFFICIENT_PERMISSIONS` | The card issuer has declined the transaction due to restrictions on where the card can be used.
For example, a gift card is limited to a single merchant. | +| `INVALID_LOCATION` | The Square account cannot take payments in the specified region.
A Square account can take payments only from the region where the account was created. | +| `TRANSACTION_LIMIT` | The card issuer has determined the payment amount is either too high or too low.
The API returns the error code mostly for credit cards (for example, the card reached
the credit limit). However, sometimes the issuer bank can indicate the error for debit
or prepaid cards (for example, card has insufficient funds). | +| `VOICE_FAILURE` | 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. | +| `PAN_FAILURE` | The specified card number is invalid. For example, it is of
incorrect length or is incorrectly formatted. | +| `EXPIRATION_FAILURE` | The card expiration date is either invalid or indicates that the
card is expired. | +| `CARD_NOT_SUPPORTED` | The card is not supported either in the geographic region or by
the [merchant category code](https://developer.squareup.com/docs/locations-api#initialize-a-merchant-category-code) (MCC). | +| `INVALID_PIN` | The card issuer declined the request because the PIN is invalid. | +| `MISSING_PIN` | The payment is missing a required PIN. | +| `MISSING_ACCOUNT_TYPE` | The payment is missing a required ACCOUNT_TYPE parameter. | +| `INVALID_POSTAL_CODE` | The postal code is incorrectly formatted. | +| `INVALID_FEES` | The app_fee_money on a payment is too high. | +| `MANUALLY_ENTERED_PAYMENT_NOT_SUPPORTED` | The card must be swiped, tapped, or dipped. Payments attempted by manually entering the card number are declined. | +| `PAYMENT_LIMIT_EXCEEDED` | Square declined the request because the payment amount exceeded the processing limit for this merchant. | +| `GIFT_CARD_AVAILABLE_AMOUNT` | When a Gift Card is a payment source, you can allow taking a partial payment
by adding the `accept_partial_authorization` parameter in the request.
However, taking such a partial payment does not work if your request also includes
`tip_money`, `app_fee_money`, or both. Square declines such payments and returns
the `GIFT_CARD_AVAILABLE_AMOUNT` error.
For more information, see
[CreatePayment errors (additional information)](https://developer.squareup.com/docs/payments-api/error-codes#createpayment-errors-additional-information). | +| `ACCOUNT_UNUSABLE` | The account provided cannot carry out transactions. | +| `BUYER_REFUSED_PAYMENT` | Bank account rejected or was not authorized for the payment. | +| `DELAYED_TRANSACTION_EXPIRED` | The application tried to update a delayed-capture payment that has expired. | +| `DELAYED_TRANSACTION_CANCELED` | The application tried to cancel a delayed-capture payment that was already cancelled. | +| `DELAYED_TRANSACTION_CAPTURED` | The application tried to capture a delayed-capture payment that was already captured. | +| `DELAYED_TRANSACTION_FAILED` | The application tried to update a delayed-capture payment that failed. | +| `CARD_TOKEN_EXPIRED` | The provided card token (nonce) has expired. | +| `CARD_TOKEN_USED` | The provided card token (nonce) was already used to process the payment or refund. | +| `AMOUNT_TOO_HIGH` | The requested payment amount is too high for the provided payment source. | +| `UNSUPPORTED_INSTRUMENT_TYPE` | The API request references an unsupported instrument type. | +| `REFUND_AMOUNT_INVALID` | The requested refund amount exceeds the amount available to refund. | +| `REFUND_ALREADY_PENDING` | The payment already has a pending refund. | +| `PAYMENT_NOT_REFUNDABLE` | The payment is not refundable. For example, the payment is too old to be refunded. | +| `PAYMENT_NOT_REFUNDABLE_DUE_TO_DISPUTE` | The payment is not refundable because it has been disputed. | +| `REFUND_DECLINED` | Request failed - The card issuer declined the refund. | +| `INSUFFICIENT_PERMISSIONS_FOR_REFUND` | The Square account does not have the permissions to process this refund. | +| `INVALID_CARD_DATA` | Generic error - the provided card data is invalid. | +| `SOURCE_USED` | The provided source id was already used to create a card. | +| `SOURCE_EXPIRED` | The provided source id has expired. | +| `UNSUPPORTED_LOYALTY_REWARD_TIER` | The referenced loyalty program reward tier is not supported.
This could happen if the reward tier created in a first party
application is incompatible with the Loyalty API. | +| `LOCATION_MISMATCH` | Generic error - the given location does not matching what is expected. | +| `IDEMPOTENCY_KEY_REUSED` | The provided idempotency key has already been used. | +| `UNEXPECTED_VALUE` | General error - the value provided was unexpected. | +| `SANDBOX_NOT_SUPPORTED` | The API request is not supported in sandbox. | +| `INVALID_EMAIL_ADDRESS` | The provided email address is invalid. | +| `INVALID_PHONE_NUMBER` | The provided phone number is invalid. | +| `CHECKOUT_EXPIRED` | The provided checkout URL has expired. | +| `BAD_CERTIFICATE` | Bad certificate. | +| `INVALID_SQUARE_VERSION_FORMAT` | The provided Square-Version is incorrectly formatted. | +| `API_VERSION_INCOMPATIBLE` | The provided Square-Version is incompatible with the requested action. | +| `CARD_PRESENCE_REQUIRED` | The transaction requires that a card be present. | +| `UNSUPPORTED_SOURCE_TYPE` | The API request references an unsupported source type. | +| `CARD_MISMATCH` | The provided card does not match what is expected. | +| `PLAID_ERROR` | Generic plaid error | +| `PLAID_ERROR_ITEM_LOGIN_REQUIRED` | Plaid error - ITEM_LOGIN_REQUIRED | +| `PLAID_ERROR_RATE_LIMIT` | Plaid error - RATE_LIMIT | +| `CARD_DECLINED` | The card was declined. | +| `VERIFY_CVV_FAILURE` | The CVV could not be verified. | +| `VERIFY_AVS_FAILURE` | The AVS could not be verified. | +| `CARD_DECLINED_CALL_ISSUER` | The payment card was declined with a request
for the card holder to call the issuer. | +| `CARD_DECLINED_VERIFICATION_REQUIRED` | The payment card was declined with a request
for additional verification. | +| `BAD_EXPIRATION` | The card expiration date is either missing or
incorrectly formatted. | +| `CHIP_INSERTION_REQUIRED` | The card issuer requires that the card be read
using a chip reader. | +| `ALLOWABLE_PIN_TRIES_EXCEEDED` | The card has exhausted its available pin entry
retries set by the card issuer. Resolving the error typically requires the
card holder to contact the card issuer. | +| `RESERVATION_DECLINED` | The card issuer declined the refund. | +| `UNKNOWN_BODY_PARAMETER` | The body parameter is not recognized by the requested endpoint. | +| `NOT_FOUND` | Not Found - a general error occurred. | +| `APPLE_PAYMENT_PROCESSING_CERTIFICATE_HASH_NOT_FOUND` | Square could not find the associated Apple Pay certificate. | +| `METHOD_NOT_ALLOWED` | Method Not Allowed - a general error occurred. | +| `NOT_ACCEPTABLE` | Not Acceptable - a general error occurred. | +| `REQUEST_TIMEOUT` | Request Timeout - a general error occurred. | +| `CONFLICT` | Conflict - a general error occurred. | +| `GONE` | The target resource is no longer available and this
condition is likely to be permanent. | +| `REQUEST_ENTITY_TOO_LARGE` | Request Entity Too Large - a general error occurred. | +| `UNSUPPORTED_MEDIA_TYPE` | Unsupported Media Type - a general error occurred. | +| `UNPROCESSABLE_ENTITY` | Unprocessable Entity - a general error occurred. | +| `RATE_LIMITED` | Rate Limited - a general error occurred. | +| `NOT_IMPLEMENTED` | Not Implemented - a general error occurred. | +| `BAD_GATEWAY` | Bad Gateway - a general error occurred. | +| `SERVICE_UNAVAILABLE` | Service Unavailable - a general error occurred. | +| `TEMPORARY_ERROR` | A temporary internal error occurred. You can safely retry your call
using the same idempotency key. | +| `GATEWAY_TIMEOUT` | Gateway Timeout - a general error occurred. | + diff --git a/legacy/doc/models/error.md b/legacy/doc/models/error.md new file mode 100644 index 000000000..6bf4c9550 --- /dev/null +++ b/legacy/doc/models/error.md @@ -0,0 +1,31 @@ + +# Error + +Represents an error encountered during a request to the Connect API. + +See [Handling errors](https://developer.squareup.com/docs/build-basics/handling-errors) for more information. + +## Structure + +`Error` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `category` | [`string`](../../doc/models/error-category.md) | Required | Indicates which high-level category of error has occurred during a
request to the Connect API. | +| `code` | [`string`](../../doc/models/error-code.md) | Required | Indicates the specific error that occurred during a request to a
Square API. | +| `detail` | `string \| undefined` | Optional | A human-readable description of the error for debugging purposes. | +| `field` | `string \| undefined` | Optional | The name of the field provided in the original request (if any) that
the error pertains to. | + +## Example (as JSON) + +```json +{ + "category": "API_ERROR", + "code": "INVALID_PAUSE_LENGTH", + "detail": "detail0", + "field": "field8" +} +``` + diff --git a/legacy/doc/models/event-data.md b/legacy/doc/models/event-data.md new file mode 100644 index 000000000..ac00fcfec --- /dev/null +++ b/legacy/doc/models/event-data.md @@ -0,0 +1,30 @@ + +# Event Data + +## Structure + +`EventData` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `type` | `string \| null \| undefined` | Optional | The name of the affected object’s type. | +| `id` | `string \| undefined` | Optional | The ID of the affected object. | +| `deleted` | `boolean \| null \| undefined` | Optional | This is true if the affected object has been deleted; otherwise, it's absent. | +| `object` | `Record \| null \| undefined` | Optional | An object containing fields and values relevant to the event. It is absent if the affected object has been deleted. | + +## Example (as JSON) + +```json +{ + "type": "type2", + "id": "id8", + "deleted": false, + "object": { + "key1": "val1", + "key2": "val2" + } +} +``` + diff --git a/legacy/doc/models/event-metadata.md b/legacy/doc/models/event-metadata.md new file mode 100644 index 000000000..9f3be7faa --- /dev/null +++ b/legacy/doc/models/event-metadata.md @@ -0,0 +1,25 @@ + +# Event Metadata + +Contains metadata about a particular [Event](../../doc/models/event.md). + +## Structure + +`EventMetadata` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `eventId` | `string \| null \| undefined` | Optional | A unique ID for the event. | +| `apiVersion` | `string \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "event_id": "event_id0", + "api_version": "api_version6" +} +``` + diff --git a/legacy/doc/models/event-type-metadata.md b/legacy/doc/models/event-type-metadata.md new file mode 100644 index 000000000..0bb841207 --- /dev/null +++ b/legacy/doc/models/event-type-metadata.md @@ -0,0 +1,27 @@ + +# Event Type Metadata + +Contains the metadata of a webhook event type. + +## Structure + +`EventTypeMetadata` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `eventType` | `string \| undefined` | Optional | The event type. | +| `apiVersionIntroduced` | `string \| undefined` | Optional | The API version at which the event type was introduced. | +| `releaseStatus` | `string \| undefined` | Optional | The release status of the event type. | + +## Example (as JSON) + +```json +{ + "event_type": "event_type0", + "api_version_introduced": "api_version_introduced0", + "release_status": "release_status4" +} +``` + diff --git a/legacy/doc/models/event.md b/legacy/doc/models/event.md new file mode 100644 index 000000000..ef55c60f8 --- /dev/null +++ b/legacy/doc/models/event.md @@ -0,0 +1,30 @@ + +# Event + +## Structure + +`Event` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `merchantId` | `string \| null \| undefined` | Optional | The ID of the target merchant associated with the event. | +| `locationId` | `string \| null \| undefined` | Optional | The ID of the target location associated with the event. | +| `type` | `string \| null \| undefined` | Optional | The type of event this represents. | +| `eventId` | `string \| null \| undefined` | Optional | A unique ID for the event. | +| `createdAt` | `string \| undefined` | Optional | Timestamp of when the event was created, in RFC 3339 format. | +| `data` | [`EventData \| undefined`](../../doc/models/event-data.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "merchant_id": "merchant_id2", + "location_id": "location_id6", + "type": "type8", + "event_id": "event_id8", + "created_at": "created_at0" +} +``` + diff --git a/legacy/doc/models/exclude-strategy.md b/legacy/doc/models/exclude-strategy.md new file mode 100644 index 000000000..a86dcc1ad --- /dev/null +++ b/legacy/doc/models/exclude-strategy.md @@ -0,0 +1,17 @@ + +# Exclude Strategy + +Indicates which products matched by a CatalogPricingRule +will be excluded if the pricing rule uses an exclude set. + +## Enumeration + +`ExcludeStrategy` + +## Fields + +| Name | Description | +| --- | --- | +| `LEAST_EXPENSIVE` | The least expensive matched products are excluded from the pricing. If
the pricing rule is set to exclude one product and multiple products in the
match set qualify as least expensive, then one will be excluded at random.

Excluding the least expensive product gives the best discount value to the buyer. | +| `MOST_EXPENSIVE` | The most expensive matched product is excluded from the pricing rule.
If multiple products have the same price and all qualify as least expensive,
one will be excluded at random.

This guarantees that the most expensive product is purchased at full price. | + diff --git a/legacy/doc/models/external-payment-details.md b/legacy/doc/models/external-payment-details.md new file mode 100644 index 000000000..fb9dcd410 --- /dev/null +++ b/legacy/doc/models/external-payment-details.md @@ -0,0 +1,34 @@ + +# External Payment Details + +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). + +## Structure + +`ExternalPaymentDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `type` | `string` | Required | 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.
**Constraints**: *Maximum Length*: `50` | +| `source` | `string` | Required | A description of the external payment source. For example,
"Food Delivery Service".
**Constraints**: *Maximum Length*: `255` | +| `sourceId` | `string \| null \| undefined` | Optional | An ID to associate the payment to its originating source.
**Constraints**: *Maximum Length*: `255` | +| `sourceFeeMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "type": "type8", + "source": "source8", + "source_id": "source_id6", + "source_fee_money": { + "amount": 130, + "currency": "NIO" + } +} +``` + diff --git a/legacy/doc/models/filter-value.md b/legacy/doc/models/filter-value.md new file mode 100644 index 000000000..0c4088fd8 --- /dev/null +++ b/legacy/doc/models/filter-value.md @@ -0,0 +1,42 @@ + +# Filter Value + +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. + +## Structure + +`FilterValue` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `all` | `string[] \| null \| undefined` | Optional | A list of terms that must be present on the field of the resource. | +| `any` | `string[] \| null \| undefined` | Optional | A list of terms where at least one of them must be present on the
field of the resource. | +| `none` | `string[] \| null \| undefined` | Optional | A list of terms that must not be present on the field the resource | + +## Example (as JSON) + +```json +{ + "all": [ + "all9", + "all0", + "all1" + ], + "any": [ + "any8", + "any9", + "any0" + ], + "none": [ + "none3", + "none4" + ] +} +``` + diff --git a/legacy/doc/models/float-number-range.md b/legacy/doc/models/float-number-range.md new file mode 100644 index 000000000..ef7823bd9 --- /dev/null +++ b/legacy/doc/models/float-number-range.md @@ -0,0 +1,25 @@ + +# Float Number Range + +Specifies a decimal number range. + +## Structure + +`FloatNumberRange` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `startAt` | `string \| null \| undefined` | Optional | A decimal value indicating where the range starts. | +| `endAt` | `string \| null \| undefined` | Optional | A decimal value indicating where the range ends. | + +## Example (as JSON) + +```json +{ + "start_at": "start_at0", + "end_at": "end_at2" +} +``` + diff --git a/legacy/doc/models/fulfillment-delivery-details-order-fulfillment-delivery-details-schedule-type.md b/legacy/doc/models/fulfillment-delivery-details-order-fulfillment-delivery-details-schedule-type.md new file mode 100644 index 000000000..0b4d55d60 --- /dev/null +++ b/legacy/doc/models/fulfillment-delivery-details-order-fulfillment-delivery-details-schedule-type.md @@ -0,0 +1,16 @@ + +# Fulfillment Delivery Details Order Fulfillment Delivery Details Schedule Type + +The schedule type of the delivery fulfillment. + +## Enumeration + +`FulfillmentDeliveryDetailsOrderFulfillmentDeliveryDetailsScheduleType` + +## Fields + +| Name | Description | +| --- | --- | +| `SCHEDULED` | Indicates the fulfillment to deliver at a scheduled deliver time. | +| `ASAP` | Indicates that the fulfillment to deliver as soon as possible and should be prepared
immediately. | + diff --git a/legacy/doc/models/fulfillment-delivery-details.md b/legacy/doc/models/fulfillment-delivery-details.md new file mode 100644 index 000000000..6757fb09e --- /dev/null +++ b/legacy/doc/models/fulfillment-delivery-details.md @@ -0,0 +1,61 @@ + +# Fulfillment Delivery Details + +Describes delivery details of an order fulfillment. + +## Structure + +`FulfillmentDeliveryDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `recipient` | [`FulfillmentRecipient \| undefined`](../../doc/models/fulfillment-recipient.md) | Optional | Information about the fulfillment recipient. | +| `scheduleType` | [`string \| undefined`](../../doc/models/fulfillment-delivery-details-order-fulfillment-delivery-details-schedule-type.md) | Optional | The schedule type of the delivery fulfillment. | +| `placedAt` | `string \| undefined` | Optional | 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". | +| `deliverAt` | `string \| null \| undefined` | Optional | 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"). | +| `prepTimeDuration` | `string \| null \| undefined` | Optional | The duration of time it takes to prepare and deliver this fulfillment.
The duration must be in RFC 3339 format (for example, "P1W3D"). | +| `deliveryWindowDuration` | `string \| null \| undefined` | Optional | 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` | `string \| null \| undefined` | Optional | Provides additional instructions about the delivery fulfillment.
It is displayed in the Square Point of Sale application and set by the API.
**Constraints**: *Maximum Length*: `550` | +| `completedAt` | `string \| null \| undefined` | Optional | 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"). | +| `inProgressAt` | `string \| undefined` | Optional | 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"). | +| `rejectedAt` | `string \| undefined` | Optional | 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"). | +| `readyAt` | `string \| undefined` | Optional | 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"). | +| `deliveredAt` | `string \| undefined` | Optional | 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"). | +| `canceledAt` | `string \| undefined` | Optional | 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"). | +| `cancelReason` | `string \| null \| undefined` | Optional | The delivery cancellation reason. Max length: 100 characters.
**Constraints**: *Maximum Length*: `100` | +| `courierPickupAt` | `string \| null \| undefined` | Optional | 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"). | +| `courierPickupWindowDuration` | `string \| null \| undefined` | Optional | 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"). | +| `isNoContactDelivery` | `boolean \| null \| undefined` | Optional | Whether the delivery is preferred to be no contact. | +| `dropoffNotes` | `string \| null \| undefined` | Optional | A note to provide additional instructions about how to deliver the order.
**Constraints**: *Maximum Length*: `550` | +| `courierProviderName` | `string \| null \| undefined` | Optional | The name of the courier provider.
**Constraints**: *Maximum Length*: `255` | +| `courierSupportPhoneNumber` | `string \| null \| undefined` | Optional | The support phone number of the courier.
**Constraints**: *Maximum Length*: `17` | +| `squareDeliveryId` | `string \| null \| undefined` | Optional | The identifier for the delivery created by Square.
**Constraints**: *Maximum Length*: `50` | +| `externalDeliveryId` | `string \| null \| undefined` | Optional | The identifier for the delivery created by the third-party courier service.
**Constraints**: *Maximum Length*: `50` | +| `managedDelivery` | `boolean \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "recipient": { + "customer_id": "customer_id6", + "display_name": "display_name8", + "email_address": "email_address4", + "phone_number": "phone_number4", + "address": { + "address_line_1": "address_line_16", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "locality": "locality6", + "sublocality": "sublocality6" + } + }, + "schedule_type": "SCHEDULED", + "placed_at": "placed_at6", + "deliver_at": "deliver_at2", + "prep_time_duration": "prep_time_duration6" +} +``` + diff --git a/legacy/doc/models/fulfillment-fulfillment-entry.md b/legacy/doc/models/fulfillment-fulfillment-entry.md new file mode 100644 index 000000000..e238c865d --- /dev/null +++ b/legacy/doc/models/fulfillment-fulfillment-entry.md @@ -0,0 +1,34 @@ + +# Fulfillment Fulfillment Entry + +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. + +## Structure + +`FulfillmentFulfillmentEntry` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string \| null \| undefined` | Optional | A unique ID that identifies the fulfillment entry only within this order.
**Constraints**: *Maximum Length*: `60` | +| `lineItemUid` | `string` | Required | The `uid` from the order line item.
**Constraints**: *Minimum Length*: `1` | +| `quantity` | `string` | Required | 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"`.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `12` | +| `metadata` | `Record \| null \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "uid": "uid0", + "line_item_uid": "line_item_uid0", + "quantity": "quantity6", + "metadata": { + "key0": "metadata3", + "key1": "metadata4" + } +} +``` + diff --git a/legacy/doc/models/fulfillment-fulfillment-line-item-application.md b/legacy/doc/models/fulfillment-fulfillment-line-item-application.md new file mode 100644 index 000000000..1e4dd975d --- /dev/null +++ b/legacy/doc/models/fulfillment-fulfillment-line-item-application.md @@ -0,0 +1,17 @@ + +# Fulfillment Fulfillment Line Item Application + +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. + +## Enumeration + +`FulfillmentFulfillmentLineItemApplication` + +## Fields + +| Name | Description | +| --- | --- | +| `ALL` | If `ALL`, `entries` must be unset. | +| `ENTRY_LIST` | If `ENTRY_LIST`, supply a list of `entries`. | + diff --git a/legacy/doc/models/fulfillment-pickup-details-curbside-pickup-details.md b/legacy/doc/models/fulfillment-pickup-details-curbside-pickup-details.md new file mode 100644 index 000000000..c30fb62ae --- /dev/null +++ b/legacy/doc/models/fulfillment-pickup-details-curbside-pickup-details.md @@ -0,0 +1,25 @@ + +# Fulfillment Pickup Details Curbside Pickup Details + +Specific details for curbside pickup. + +## Structure + +`FulfillmentPickupDetailsCurbsidePickupDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `curbsideDetails` | `string \| null \| undefined` | Optional | Specific details for curbside pickup, such as parking number and vehicle model.
**Constraints**: *Maximum Length*: `250` | +| `buyerArrivedAt` | `string \| null \| undefined` | Optional | 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"). | + +## Example (as JSON) + +```json +{ + "curbside_details": "curbside_details0", + "buyer_arrived_at": "buyer_arrived_at6" +} +``` + diff --git a/legacy/doc/models/fulfillment-pickup-details-schedule-type.md b/legacy/doc/models/fulfillment-pickup-details-schedule-type.md new file mode 100644 index 000000000..6879ccc4e --- /dev/null +++ b/legacy/doc/models/fulfillment-pickup-details-schedule-type.md @@ -0,0 +1,16 @@ + +# Fulfillment Pickup Details Schedule Type + +The schedule type of the pickup fulfillment. + +## Enumeration + +`FulfillmentPickupDetailsScheduleType` + +## Fields + +| Name | Description | +| --- | --- | +| `SCHEDULED` | Indicates that the fulfillment will be picked up at a scheduled pickup time. | +| `ASAP` | Indicates that the fulfillment will be picked up as soon as possible and
should be prepared immediately. | + diff --git a/legacy/doc/models/fulfillment-pickup-details.md b/legacy/doc/models/fulfillment-pickup-details.md new file mode 100644 index 000000000..cac5cb977 --- /dev/null +++ b/legacy/doc/models/fulfillment-pickup-details.md @@ -0,0 +1,56 @@ + +# Fulfillment Pickup Details + +Contains details necessary to fulfill a pickup order. + +## Structure + +`FulfillmentPickupDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `recipient` | [`FulfillmentRecipient \| undefined`](../../doc/models/fulfillment-recipient.md) | Optional | Information about the fulfillment recipient. | +| `expiresAt` | `string \| null \| undefined` | Optional | 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. | +| `autoCompleteDuration` | `string \| null \| undefined` | Optional | 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. | +| `scheduleType` | [`string \| undefined`](../../doc/models/fulfillment-pickup-details-schedule-type.md) | Optional | The schedule type of the pickup fulfillment. | +| `pickupAt` | `string \| null \| undefined` | Optional | 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. | +| `pickupWindowDuration` | `string \| null \| undefined` | Optional | 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. | +| `prepTimeDuration` | `string \| null \| undefined` | Optional | The duration of time it takes to prepare this fulfillment.
The duration must be in RFC 3339 format (for example, "P1W3D"). | +| `note` | `string \| null \| undefined` | Optional | A note to provide additional instructions about the pickup
fulfillment displayed in the Square Point of Sale application and set by the API.
**Constraints**: *Maximum Length*: `500` | +| `placedAt` | `string \| undefined` | Optional | 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"). | +| `acceptedAt` | `string \| undefined` | Optional | 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"). | +| `rejectedAt` | `string \| undefined` | Optional | 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"). | +| `readyAt` | `string \| undefined` | Optional | 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"). | +| `expiredAt` | `string \| undefined` | Optional | 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"). | +| `pickedUpAt` | `string \| undefined` | Optional | 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"). | +| `canceledAt` | `string \| undefined` | Optional | 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"). | +| `cancelReason` | `string \| null \| undefined` | Optional | A description of why the pickup was canceled. The maximum length: 100 characters.
**Constraints**: *Maximum Length*: `100` | +| `isCurbsidePickup` | `boolean \| null \| undefined` | Optional | If set to `true`, indicates that this pickup order is for curbside pickup, not in-store pickup. | +| `curbsidePickupDetails` | [`FulfillmentPickupDetailsCurbsidePickupDetails \| undefined`](../../doc/models/fulfillment-pickup-details-curbside-pickup-details.md) | Optional | Specific details for curbside pickup. | + +## Example (as JSON) + +```json +{ + "recipient": { + "customer_id": "customer_id6", + "display_name": "display_name8", + "email_address": "email_address4", + "phone_number": "phone_number4", + "address": { + "address_line_1": "address_line_16", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "locality": "locality6", + "sublocality": "sublocality6" + } + }, + "expires_at": "expires_at0", + "auto_complete_duration": "auto_complete_duration0", + "schedule_type": "SCHEDULED", + "pickup_at": "pickup_at8" +} +``` + diff --git a/legacy/doc/models/fulfillment-recipient.md b/legacy/doc/models/fulfillment-recipient.md new file mode 100644 index 000000000..44a765d8a --- /dev/null +++ b/legacy/doc/models/fulfillment-recipient.md @@ -0,0 +1,37 @@ + +# Fulfillment Recipient + +Information about the fulfillment recipient. + +## Structure + +`FulfillmentRecipient` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customerId` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `191` | +| `displayName` | `string \| null \| undefined` | Optional | 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`.
**Constraints**: *Maximum Length*: `255` | +| `emailAddress` | `string \| null \| undefined` | Optional | The email address of the fulfillment recipient.

If provided, the email address overrides the corresponding customer profile value
indicated by `customer_id`.
**Constraints**: *Maximum Length*: `255` | +| `phoneNumber` | `string \| null \| undefined` | Optional | 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`.
**Constraints**: *Maximum Length*: `17` | +| `address` | [`Address \| undefined`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | + +## Example (as JSON) + +```json +{ + "customer_id": "customer_id2", + "display_name": "display_name4", + "email_address": "email_address2", + "phone_number": "phone_number2", + "address": { + "address_line_1": "address_line_16", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "locality": "locality6", + "sublocality": "sublocality6" + } +} +``` + diff --git a/legacy/doc/models/fulfillment-shipment-details.md b/legacy/doc/models/fulfillment-shipment-details.md new file mode 100644 index 000000000..3e6dc6521 --- /dev/null +++ b/legacy/doc/models/fulfillment-shipment-details.md @@ -0,0 +1,53 @@ + +# Fulfillment Shipment Details + +Contains the details necessary to fulfill a shipment order. + +## Structure + +`FulfillmentShipmentDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `recipient` | [`FulfillmentRecipient \| undefined`](../../doc/models/fulfillment-recipient.md) | Optional | Information about the fulfillment recipient. | +| `carrier` | `string \| null \| undefined` | Optional | The shipping carrier being used to ship this fulfillment (such as UPS, FedEx, or USPS).
**Constraints**: *Maximum Length*: `50` | +| `shippingNote` | `string \| null \| undefined` | Optional | A note with additional information for the shipping carrier.
**Constraints**: *Maximum Length*: `500` | +| `shippingType` | `string \| null \| undefined` | Optional | A description of the type of shipping product purchased from the carrier
(such as First Class, Priority, or Express).
**Constraints**: *Maximum Length*: `50` | +| `trackingNumber` | `string \| null \| undefined` | Optional | The reference number provided by the carrier to track the shipment's progress.
**Constraints**: *Maximum Length*: `100` | +| `trackingUrl` | `string \| null \| undefined` | Optional | A link to the tracking webpage on the carrier's website.
**Constraints**: *Maximum Length*: `2000` | +| `placedAt` | `string \| undefined` | Optional | 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"). | +| `inProgressAt` | `string \| undefined` | Optional | 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"). | +| `packagedAt` | `string \| undefined` | Optional | 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"). | +| `expectedShippedAt` | `string \| null \| undefined` | Optional | 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"). | +| `shippedAt` | `string \| undefined` | Optional | 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"). | +| `canceledAt` | `string \| null \| undefined` | Optional | 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"). | +| `cancelReason` | `string \| null \| undefined` | Optional | A description of why the shipment was canceled.
**Constraints**: *Maximum Length*: `100` | +| `failedAt` | `string \| undefined` | Optional | 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"). | +| `failureReason` | `string \| null \| undefined` | Optional | A description of why the shipment failed to be completed.
**Constraints**: *Maximum Length*: `100` | + +## Example (as JSON) + +```json +{ + "recipient": { + "customer_id": "customer_id6", + "display_name": "display_name8", + "email_address": "email_address4", + "phone_number": "phone_number4", + "address": { + "address_line_1": "address_line_16", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "locality": "locality6", + "sublocality": "sublocality6" + } + }, + "carrier": "carrier6", + "shipping_note": "shipping_note0", + "shipping_type": "shipping_type2", + "tracking_number": "tracking_number2" +} +``` + diff --git a/legacy/doc/models/fulfillment-state.md b/legacy/doc/models/fulfillment-state.md new file mode 100644 index 000000000..7d4cc072f --- /dev/null +++ b/legacy/doc/models/fulfillment-state.md @@ -0,0 +1,20 @@ + +# Fulfillment State + +The current state of this fulfillment. + +## Enumeration + +`FulfillmentState` + +## Fields + +| Name | Description | +| --- | --- | +| `PROPOSED` | Indicates that the fulfillment has been proposed. | +| `RESERVED` | Indicates that the fulfillment has been reserved. | +| `PREPARED` | Indicates that the fulfillment has been prepared. | +| `COMPLETED` | Indicates that the fulfillment was successfully completed. | +| `CANCELED` | Indicates that the fulfillment was canceled. | +| `FAILED` | Indicates that the fulfillment failed to be completed, but was not explicitly
canceled. | + diff --git a/legacy/doc/models/fulfillment-type.md b/legacy/doc/models/fulfillment-type.md new file mode 100644 index 000000000..cada76fdd --- /dev/null +++ b/legacy/doc/models/fulfillment-type.md @@ -0,0 +1,17 @@ + +# Fulfillment Type + +The type of fulfillment. + +## Enumeration + +`FulfillmentType` + +## Fields + +| Name | Description | +| --- | --- | +| `PICKUP` | A recipient to pick up the fulfillment from a physical [location](../../doc/models/location.md). | +| `SHIPMENT` | A shipping carrier to ship the fulfillment. | +| `DELIVERY` | A courier to deliver the fulfillment. | + diff --git a/legacy/doc/models/fulfillment.md b/legacy/doc/models/fulfillment.md new file mode 100644 index 000000000..71e649cd0 --- /dev/null +++ b/legacy/doc/models/fulfillment.md @@ -0,0 +1,48 @@ + +# Fulfillment + +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. + +## Structure + +`Fulfillment` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string \| null \| undefined` | Optional | A unique ID that identifies the fulfillment only within this order.
**Constraints**: *Maximum Length*: `60` | +| `type` | [`string \| undefined`](../../doc/models/fulfillment-type.md) | Optional | The type of fulfillment. | +| `state` | [`string \| undefined`](../../doc/models/fulfillment-state.md) | Optional | The current state of this fulfillment. | +| `lineItemApplication` | [`string \| undefined`](../../doc/models/fulfillment-fulfillment-line-item-application.md) | Optional | 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. | +| `entries` | [`FulfillmentFulfillmentEntry[] \| undefined`](../../doc/models/fulfillment-fulfillment-entry.md) | Optional | 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. | +| `metadata` | `Record \| null \| undefined` | Optional | 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). | +| `pickupDetails` | [`FulfillmentPickupDetails \| undefined`](../../doc/models/fulfillment-pickup-details.md) | Optional | Contains details necessary to fulfill a pickup order. | +| `shipmentDetails` | [`FulfillmentShipmentDetails \| undefined`](../../doc/models/fulfillment-shipment-details.md) | Optional | Contains the details necessary to fulfill a shipment order. | +| `deliveryDetails` | [`FulfillmentDeliveryDetails \| undefined`](../../doc/models/fulfillment-delivery-details.md) | Optional | Describes delivery details of an order fulfillment. | + +## Example (as JSON) + +```json +{ + "uid": "uid0", + "type": "DELIVERY", + "state": "CANCELED", + "line_item_application": "ALL", + "entries": [ + { + "uid": "uid0", + "line_item_uid": "line_item_uid0", + "quantity": "quantity6", + "metadata": { + "key0": "metadata3", + "key1": "metadata4", + "key2": "metadata5" + } + } + ] +} +``` + diff --git a/legacy/doc/models/get-bank-account-by-v1-id-response.md b/legacy/doc/models/get-bank-account-by-v1-id-response.md new file mode 100644 index 000000000..4c1c09aad --- /dev/null +++ b/legacy/doc/models/get-bank-account-by-v1-id-response.md @@ -0,0 +1,62 @@ + +# Get Bank Account by V1 Id Response + +Response object returned by GetBankAccountByV1Id. + +## Structure + +`GetBankAccountByV1IdResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | +| `bankAccount` | [`BankAccount \| undefined`](../../doc/models/bank-account.md) | Optional | 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). | + +## Example (as JSON) + +```json +{ + "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, + "secondary_bank_identification_number": "secondary_bank_identification_number4", + "debit_mandate_reference_id": "debit_mandate_reference_id0", + "reference_id": "reference_id2", + "fingerprint": "fingerprint0" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/get-bank-account-response.md b/legacy/doc/models/get-bank-account-response.md new file mode 100644 index 000000000..81d91a19d --- /dev/null +++ b/legacy/doc/models/get-bank-account-response.md @@ -0,0 +1,50 @@ + +# Get Bank Account Response + +Response object returned by `GetBankAccount`. + +## Structure + +`GetBankAccountResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | +| `bankAccount` | [`BankAccount \| undefined`](../../doc/models/bank-account.md) | Optional | 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). | + +## Example (as JSON) + +```json +{ + "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, + "secondary_bank_identification_number": "secondary_bank_identification_number4", + "debit_mandate_reference_id": "debit_mandate_reference_id0", + "reference_id": "reference_id2", + "fingerprint": "fingerprint0" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/get-break-type-response.md b/legacy/doc/models/get-break-type-response.md new file mode 100644 index 000000000..c66405396 --- /dev/null +++ b/legacy/doc/models/get-break-type-response.md @@ -0,0 +1,49 @@ + +# Get Break Type Response + +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. + +## Structure + +`GetBreakTypeResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `breakType` | [`BreakType \| undefined`](../../doc/models/break-type.md) | Optional | A defined break template that sets an expectation for possible `Break`
instances on a `Shift`. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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 + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/get-device-code-response.md b/legacy/doc/models/get-device-code-response.md new file mode 100644 index 000000000..54fbba453 --- /dev/null +++ b/legacy/doc/models/get-device-code-response.md @@ -0,0 +1,41 @@ + +# Get Device Code Response + +## Structure + +`GetDeviceCodeResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `deviceCode` | [`DeviceCode \| undefined`](../../doc/models/device-code.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "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" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/get-device-response.md b/legacy/doc/models/get-device-response.md new file mode 100644 index 000000000..fb04916ba --- /dev/null +++ b/legacy/doc/models/get-device-response.md @@ -0,0 +1,191 @@ + +# Get Device Response + +## Structure + +`GetDeviceResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | +| `device` | [`Device \| undefined`](../../doc/models/device.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "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", + "device_code_id": "device_code_id2" + }, + "type": "APPLICATION", + "card_reader_details": { + "version": "version0" + }, + "battery_details": { + "visible_percent": 108, + "external_power": "AVAILABLE_CHARGING" + }, + "wifi_details": { + "active": false, + "ssid": "ssid8", + "ip_address_v4": "ip_address_v42", + "secure_connection": "secure_connection8", + "signal_strength": { + "value": 222 + } + }, + "ethernet_details": { + "active": false, + "ip_address_v4": "ip_address_v42" + } + }, + { + "card_reader_details": { + "version": "3.53.70" + }, + "type": "CARD_READER", + "application_details": { + "application_type": "TERMINAL_API", + "version": "version4", + "session_location": "session_location0", + "device_code_id": "device_code_id2" + }, + "battery_details": { + "visible_percent": 108, + "external_power": "AVAILABLE_CHARGING" + }, + "wifi_details": { + "active": false, + "ssid": "ssid8", + "ip_address_v4": "ip_address_v42", + "secure_connection": "secure_connection8", + "signal_strength": { + "value": 222 + } + }, + "ethernet_details": { + "active": false, + "ip_address_v4": "ip_address_v42" + } + }, + { + "battery_details": { + "external_power": "AVAILABLE_CHARGING", + "visible_percent": 5 + }, + "type": "BATTERY", + "application_details": { + "application_type": "TERMINAL_API", + "version": "version4", + "session_location": "session_location0", + "device_code_id": "device_code_id2" + }, + "card_reader_details": { + "version": "version0" + }, + "wifi_details": { + "active": false, + "ssid": "ssid8", + "ip_address_v4": "ip_address_v42", + "secure_connection": "secure_connection8", + "signal_strength": { + "value": 222 + } + }, + "ethernet_details": { + "active": false, + "ip_address_v4": "ip_address_v42" + } + }, + { + "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" + }, + "application_details": { + "application_type": "TERMINAL_API", + "version": "version4", + "session_location": "session_location0", + "device_code_id": "device_code_id2" + }, + "card_reader_details": { + "version": "version0" + }, + "battery_details": { + "visible_percent": 108, + "external_power": "AVAILABLE_CHARGING" + }, + "ethernet_details": { + "active": false, + "ip_address_v4": "ip_address_v42" + } + }, + { + "ethernet_details": { + "active": false + }, + "type": "ETHERNET", + "application_details": { + "application_type": "TERMINAL_API", + "version": "version4", + "session_location": "session_location0", + "device_code_id": "device_code_id2" + }, + "card_reader_details": { + "version": "version0" + }, + "battery_details": { + "visible_percent": 108, + "external_power": "AVAILABLE_CHARGING" + }, + "wifi_details": { + "active": false, + "ssid": "ssid8", + "ip_address_v4": "ip_address_v42", + "secure_connection": "secure_connection8", + "signal_strength": { + "value": 222 + } + } + } + ], + "id": "device:995CS397A6475287", + "status": { + "category": "AVAILABLE" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/get-employee-wage-response.md b/legacy/doc/models/get-employee-wage-response.md new file mode 100644 index 000000000..d6a6ba7a4 --- /dev/null +++ b/legacy/doc/models/get-employee-wage-response.md @@ -0,0 +1,54 @@ + +# Get Employee Wage Response + +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. + +## Structure + +`GetEmployeeWageResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `employeeWage` | [`EmployeeWage \| undefined`](../../doc/models/employee-wage.md) | Optional | 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). | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "employee_wage": { + "employee_id": "33fJchumvVdJwxV0H6L9", + "hourly_rate": { + "amount": 2000, + "currency": "USD" + }, + "id": "pXS3qCv7BERPnEGedM4S8mhm", + "title": "Manager" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/get-invoice-response.md b/legacy/doc/models/get-invoice-response.md new file mode 100644 index 000000000..0d961740e --- /dev/null +++ b/legacy/doc/models/get-invoice-response.md @@ -0,0 +1,106 @@ + +# Get Invoice Response + +Describes a `GetInvoice` response. + +## Structure + +`GetInvoiceResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `invoice` | [`Invoice \| undefined`](../../doc/models/invoice.md) | Optional | 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). | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | + +## Example (as JSON) + +```json +{ + "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", + "address": { + "address_line_1": "address_line_16", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "locality": "locality6", + "sublocality": "sublocality6" + } + }, + "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 + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/get-payment-refund-response.md b/legacy/doc/models/get-payment-refund-response.md new file mode 100644 index 000000000..1c89c5559 --- /dev/null +++ b/legacy/doc/models/get-payment-refund-response.md @@ -0,0 +1,100 @@ + +# Get Payment Refund Response + +Defines the response returned by [GetRefund](../../doc/api/refunds.md#get-payment-refund). + +Note: If there are errors processing the request, the refund field might not be +present or it might be present in a FAILED state. + +## Structure + +`GetPaymentRefundResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | +| `refund` | [`PaymentRefund \| undefined`](../../doc/models/payment-refund.md) | Optional | Represents a refund of a payment made using Square. Contains information about
the original payment and the amount of money refunded. | + +## Example (as JSON) + +```json +{ + "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", + "unlinked": false, + "destination_type": "destination_type2", + "destination_details": { + "card_details": { + "card": { + "id": "id6", + "card_brand": "OTHER_BRAND", + "last_4": "last_48", + "exp_month": 228, + "exp_year": 68 + }, + "entry_method": "entry_method8", + "auth_result_code": "auth_result_code0" + }, + "cash_details": { + "seller_supplied_money": { + "amount": 36, + "currency": "MKD" + }, + "change_back_money": { + "amount": 78, + "currency": "XBD" + } + }, + "external_details": { + "type": "type6", + "source": "source0", + "source_id": "source_id8" + } + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/get-payment-response.md b/legacy/doc/models/get-payment-response.md new file mode 100644 index 000000000..030e80ea3 --- /dev/null +++ b/legacy/doc/models/get-payment-response.md @@ -0,0 +1,101 @@ + +# Get Payment Response + +Defines the response returned by [GetPayment](../../doc/api/payments.md#get-payment). + +## Structure + +`GetPaymentResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | +| `payment` | [`Payment \| undefined`](../../doc/models/payment.md) | Optional | Represents a payment processed by the Square API. | + +## Example (as JSON) + +```json +{ + "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", + "tip_money": { + "amount": 190, + "currency": "TWD" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/get-payout-response.md b/legacy/doc/models/get-payout-response.md new file mode 100644 index 000000000..e412961b6 --- /dev/null +++ b/legacy/doc/models/get-payout-response.md @@ -0,0 +1,54 @@ + +# Get Payout Response + +## Structure + +`GetPayoutResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `payout` | [`Payout \| undefined`](../../doc/models/payout.md) | Optional | An accounting of the amount owed the seller and record of the actual transfer to their
external bank account or to the Square balance. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | + +## Example (as JSON) + +```json +{ + "payout": { + "amount_money": { + "amount": -103, + "currency_code": "USD", + "currency": "AUD" + }, + "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 + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/get-shift-response.md b/legacy/doc/models/get-shift-response.md new file mode 100644 index 000000000..eeafeb1d4 --- /dev/null +++ b/legacy/doc/models/get-shift-response.md @@ -0,0 +1,82 @@ + +# Get Shift Response + +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. + +## Structure + +`GetShiftResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `shift` | [`Shift \| undefined`](../../doc/models/shift.md) | Optional | 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. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/get-team-member-wage-response.md b/legacy/doc/models/get-team-member-wage-response.md new file mode 100644 index 000000000..a3b9e9a7d --- /dev/null +++ b/legacy/doc/models/get-team-member-wage-response.md @@ -0,0 +1,44 @@ + +# Get Team Member Wage Response + +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. + +## Structure + +`GetTeamMemberWageResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `teamMemberWage` | [`TeamMemberWage \| undefined`](../../doc/models/team-member-wage.md) | Optional | The hourly wage rate that a team member earns on a `Shift` for doing the job
specified by the `title` property of this object. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "team_member_wage": { + "hourly_rate": { + "amount": 2000, + "currency": "USD" + }, + "id": "pXS3qCv7BERPnEGedM4S8mhm", + "job_id": "jxJNN6eCJsLrhg5UFJrDWDGE", + "team_member_id": "33fJchumvVdJwxV0H6L9", + "tip_eligible": false, + "title": "Manager" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/get-terminal-action-response.md b/legacy/doc/models/get-terminal-action-response.md new file mode 100644 index 000000000..12d2ad324 --- /dev/null +++ b/legacy/doc/models/get-terminal-action-response.md @@ -0,0 +1,51 @@ + +# Get Terminal Action Response + +## Structure + +`GetTerminalActionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | +| `action` | [`TerminalAction \| undefined`](../../doc/models/terminal-action.md) | Optional | Represents an action processed by the Square Terminal. | + +## Example (as JSON) + +```json +{ + "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", + "cancel_reason": "TIMED_OUT" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/get-terminal-checkout-response.md b/legacy/doc/models/get-terminal-checkout-response.md new file mode 100644 index 000000000..2768adf96 --- /dev/null +++ b/legacy/doc/models/get-terminal-checkout-response.md @@ -0,0 +1,66 @@ + +# Get Terminal Checkout Response + +## Structure + +`GetTerminalCheckoutResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | +| `checkout` | [`TerminalCheckout \| undefined`](../../doc/models/terminal-checkout.md) | Optional | Represents a checkout processed by the Square Terminal. | + +## Example (as JSON) + +```json +{ + "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, + "separate_tip_screen": false, + "custom_tip_field": false, + "tip_percentages": [ + 48 + ], + "smart_tipping": false + }, + "collect_signature": false, + "show_itemized_cart": 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", + "order_id": "order_id6", + "payment_options": { + "autocomplete": false, + "delay_duration": "delay_duration2", + "accept_partial_authorization": false, + "delay_action": "CANCEL" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/get-terminal-refund-response.md b/legacy/doc/models/get-terminal-refund-response.md new file mode 100644 index 000000000..97a307ada --- /dev/null +++ b/legacy/doc/models/get-terminal-refund-response.md @@ -0,0 +1,56 @@ + +# Get Terminal Refund Response + +## Structure + +`GetTerminalRefundResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | +| `refund` | [`TerminalRefund \| undefined`](../../doc/models/terminal-refund.md) | Optional | Represents a payment refund processed by the Square Terminal. Only supports Interac (Canadian debit network) payment refunds. | + +## Example (as JSON) + +```json +{ + "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" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/gift-card-activity-activate.md b/legacy/doc/models/gift-card-activity-activate.md new file mode 100644 index 000000000..7ea711e83 --- /dev/null +++ b/legacy/doc/models/gift-card-activity-activate.md @@ -0,0 +1,36 @@ + +# Gift Card Activity Activate + +Represents details about an `ACTIVATE` [gift card activity type](../../doc/models/gift-card-activity-type.md). + +## Structure + +`GiftCardActivityActivate` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `amountMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `orderId` | `string \| null \| undefined` | Optional | 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. | +| `lineItemUid` | `string \| null \| undefined` | Optional | 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. | +| `referenceId` | `string \| null \| undefined` | Optional | 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. | +| `buyerPaymentInstrumentIds` | `string[] \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "order_id": "order_id2", + "line_item_uid": "line_item_uid4", + "reference_id": "reference_id8", + "buyer_payment_instrument_ids": [ + "buyer_payment_instrument_ids0" + ] +} +``` + diff --git a/legacy/doc/models/gift-card-activity-adjust-decrement-reason.md b/legacy/doc/models/gift-card-activity-adjust-decrement-reason.md new file mode 100644 index 000000000..6af176038 --- /dev/null +++ b/legacy/doc/models/gift-card-activity-adjust-decrement-reason.md @@ -0,0 +1,18 @@ + +# Gift Card Activity Adjust Decrement Reason + +Indicates the reason for deducting money from a [gift card](../../doc/models/gift-card.md). + +## Enumeration + +`GiftCardActivityAdjustDecrementReason` + +## Fields + +| Name | Description | +| --- | --- | +| `SUSPICIOUS_ACTIVITY` | The balance was decreased because the seller detected suspicious or fraudulent activity
on the gift card. | +| `BALANCE_ACCIDENTALLY_INCREASED` | The balance was decreased to reverse an unintentional balance increase. | +| `SUPPORT_ISSUE` | The balance was decreased to accommodate support issues. | +| `PURCHASE_WAS_REFUNDED` | The balance was decreased because the order used to purchase or reload the
gift card was refunded. | + diff --git a/legacy/doc/models/gift-card-activity-adjust-decrement.md b/legacy/doc/models/gift-card-activity-adjust-decrement.md new file mode 100644 index 000000000..e354bb6b7 --- /dev/null +++ b/legacy/doc/models/gift-card-activity-adjust-decrement.md @@ -0,0 +1,28 @@ + +# Gift Card Activity Adjust Decrement + +Represents details about an `ADJUST_DECREMENT` [gift card activity type](../../doc/models/gift-card-activity-type.md). + +## Structure + +`GiftCardActivityAdjustDecrement` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `amountMoney` | [`Money`](../../doc/models/money.md) | Required | 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. | +| `reason` | [`string`](../../doc/models/gift-card-activity-adjust-decrement-reason.md) | Required | Indicates the reason for deducting money from a [gift card](../../doc/models/gift-card.md). | + +## Example (as JSON) + +```json +{ + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "reason": "SUPPORT_ISSUE" +} +``` + diff --git a/legacy/doc/models/gift-card-activity-adjust-increment-reason.md b/legacy/doc/models/gift-card-activity-adjust-increment-reason.md new file mode 100644 index 000000000..c7bebb4d2 --- /dev/null +++ b/legacy/doc/models/gift-card-activity-adjust-increment-reason.md @@ -0,0 +1,17 @@ + +# Gift Card Activity Adjust Increment Reason + +Indicates the reason for adding money to a [gift card](../../doc/models/gift-card.md). + +## Enumeration + +`GiftCardActivityAdjustIncrementReason` + +## Fields + +| Name | Description | +| --- | --- | +| `COMPLIMENTARY` | The seller gifted a complimentary gift card balance increase. | +| `SUPPORT_ISSUE` | The seller increased the gift card balance
to accommodate support issues. | +| `TRANSACTION_VOIDED` | The transaction is voided. | + diff --git a/legacy/doc/models/gift-card-activity-adjust-increment.md b/legacy/doc/models/gift-card-activity-adjust-increment.md new file mode 100644 index 000000000..2eade3074 --- /dev/null +++ b/legacy/doc/models/gift-card-activity-adjust-increment.md @@ -0,0 +1,28 @@ + +# Gift Card Activity Adjust Increment + +Represents details about an `ADJUST_INCREMENT` [gift card activity type](../../doc/models/gift-card-activity-type.md). + +## Structure + +`GiftCardActivityAdjustIncrement` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `amountMoney` | [`Money`](../../doc/models/money.md) | Required | 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. | +| `reason` | [`string`](../../doc/models/gift-card-activity-adjust-increment-reason.md) | Required | Indicates the reason for adding money to a [gift card](../../doc/models/gift-card.md). | + +## Example (as JSON) + +```json +{ + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "reason": "COMPLIMENTARY" +} +``` + diff --git a/legacy/doc/models/gift-card-activity-block-reason.md b/legacy/doc/models/gift-card-activity-block-reason.md new file mode 100644 index 000000000..6bf54c740 --- /dev/null +++ b/legacy/doc/models/gift-card-activity-block-reason.md @@ -0,0 +1,15 @@ + +# Gift Card Activity Block Reason + +Indicates the reason for blocking a [gift card](../../doc/models/gift-card.md). + +## Enumeration + +`GiftCardActivityBlockReason` + +## Fields + +| Name | Description | +| --- | --- | +| `CHARGEBACK_BLOCK` | The gift card is blocked because the buyer initiated a chargeback on the gift card purchase. | + diff --git a/legacy/doc/models/gift-card-activity-block.md b/legacy/doc/models/gift-card-activity-block.md new file mode 100644 index 000000000..107514f94 --- /dev/null +++ b/legacy/doc/models/gift-card-activity-block.md @@ -0,0 +1,23 @@ + +# Gift Card Activity Block + +Represents details about a `BLOCK` [gift card activity type](../../doc/models/gift-card-activity-type.md). + +## Structure + +`GiftCardActivityBlock` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `reason` | `string` | Required, Constant | Indicates the reason for blocking a [gift card](../../doc/models/gift-card.md).
**Default**: `'CHARGEBACK_BLOCK'` | + +## Example (as JSON) + +```json +{ + "reason": "CHARGEBACK_BLOCK" +} +``` + diff --git a/legacy/doc/models/gift-card-activity-clear-balance-reason.md b/legacy/doc/models/gift-card-activity-clear-balance-reason.md new file mode 100644 index 000000000..64a284914 --- /dev/null +++ b/legacy/doc/models/gift-card-activity-clear-balance-reason.md @@ -0,0 +1,17 @@ + +# Gift Card Activity Clear Balance Reason + +Indicates the reason for clearing the balance of a [gift card](../../doc/models/gift-card.md). + +## Enumeration + +`GiftCardActivityClearBalanceReason` + +## Fields + +| Name | Description | +| --- | --- | +| `SUSPICIOUS_ACTIVITY` | The seller suspects suspicious activity. | +| `REUSE_GIFTCARD` | The seller cleared the balance to reuse the gift card. | +| `UNKNOWN_REASON` | The gift card balance was cleared for an unknown reason.

This reason is read-only and cannot be used to create a `CLEAR_BALANCE` activity using the Gift Card Activities API. | + diff --git a/legacy/doc/models/gift-card-activity-clear-balance.md b/legacy/doc/models/gift-card-activity-clear-balance.md new file mode 100644 index 000000000..236458c57 --- /dev/null +++ b/legacy/doc/models/gift-card-activity-clear-balance.md @@ -0,0 +1,23 @@ + +# Gift Card Activity Clear Balance + +Represents details about a `CLEAR_BALANCE` [gift card activity type](../../doc/models/gift-card-activity-type.md). + +## Structure + +`GiftCardActivityClearBalance` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `reason` | [`string`](../../doc/models/gift-card-activity-clear-balance-reason.md) | Required | Indicates the reason for clearing the balance of a [gift card](../../doc/models/gift-card.md). | + +## Example (as JSON) + +```json +{ + "reason": "SUSPICIOUS_ACTIVITY" +} +``` + diff --git a/legacy/doc/models/gift-card-activity-deactivate-reason.md b/legacy/doc/models/gift-card-activity-deactivate-reason.md new file mode 100644 index 000000000..9cc8fd8d0 --- /dev/null +++ b/legacy/doc/models/gift-card-activity-deactivate-reason.md @@ -0,0 +1,17 @@ + +# Gift Card Activity Deactivate Reason + +Indicates the reason for deactivating a [gift card](../../doc/models/gift-card.md). + +## Enumeration + +`GiftCardActivityDeactivateReason` + +## Fields + +| Name | Description | +| --- | --- | +| `SUSPICIOUS_ACTIVITY` | The seller suspects suspicious activity. | +| `UNKNOWN_REASON` | The gift card was deactivated for an unknown reason.

This reason is read-only and cannot be used to create a `DEACTIVATE` activity using the Gift Card Activities API. | +| `CHARGEBACK_DEACTIVATE` | A chargeback on the gift card purchase (or the gift card load) was ruled in favor of the buyer.

This reason is read-only and cannot be used to create a `DEACTIVATE` activity using the Gift Card Activities API. | + diff --git a/legacy/doc/models/gift-card-activity-deactivate.md b/legacy/doc/models/gift-card-activity-deactivate.md new file mode 100644 index 000000000..80cc26759 --- /dev/null +++ b/legacy/doc/models/gift-card-activity-deactivate.md @@ -0,0 +1,23 @@ + +# Gift Card Activity Deactivate + +Represents details about a `DEACTIVATE` [gift card activity type](../../doc/models/gift-card-activity-type.md). + +## Structure + +`GiftCardActivityDeactivate` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `reason` | [`string`](../../doc/models/gift-card-activity-deactivate-reason.md) | Required | Indicates the reason for deactivating a [gift card](../../doc/models/gift-card.md). | + +## Example (as JSON) + +```json +{ + "reason": "CHARGEBACK_DEACTIVATE" +} +``` + diff --git a/legacy/doc/models/gift-card-activity-import-reversal.md b/legacy/doc/models/gift-card-activity-import-reversal.md new file mode 100644 index 000000000..8faf4d6d0 --- /dev/null +++ b/legacy/doc/models/gift-card-activity-import-reversal.md @@ -0,0 +1,26 @@ + +# Gift Card Activity Import Reversal + +Represents details about an `IMPORT_REVERSAL` [gift card activity type](../../doc/models/gift-card-activity-type.md). + +## Structure + +`GiftCardActivityImportReversal` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `amountMoney` | [`Money`](../../doc/models/money.md) | Required | 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. | + +## Example (as JSON) + +```json +{ + "amount_money": { + "amount": 186, + "currency": "AUD" + } +} +``` + diff --git a/legacy/doc/models/gift-card-activity-import.md b/legacy/doc/models/gift-card-activity-import.md new file mode 100644 index 000000000..64bb071a1 --- /dev/null +++ b/legacy/doc/models/gift-card-activity-import.md @@ -0,0 +1,28 @@ + +# Gift Card Activity Import + +Represents details about an `IMPORT` [gift card activity type](../../doc/models/gift-card-activity-type.md). +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`. + +## Structure + +`GiftCardActivityImport` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `amountMoney` | [`Money`](../../doc/models/money.md) | Required | 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. | + +## Example (as JSON) + +```json +{ + "amount_money": { + "amount": 186, + "currency": "AUD" + } +} +``` + diff --git a/legacy/doc/models/gift-card-activity-load.md b/legacy/doc/models/gift-card-activity-load.md new file mode 100644 index 000000000..9fd32883d --- /dev/null +++ b/legacy/doc/models/gift-card-activity-load.md @@ -0,0 +1,37 @@ + +# Gift Card Activity Load + +Represents details about a `LOAD` [gift card activity type](../../doc/models/gift-card-activity-type.md). + +## Structure + +`GiftCardActivityLoad` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `amountMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `orderId` | `string \| null \| undefined` | Optional | 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. | +| `lineItemUid` | `string \| null \| undefined` | Optional | 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. | +| `referenceId` | `string \| null \| undefined` | Optional | 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. | +| `buyerPaymentInstrumentIds` | `string[] \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "order_id": "order_id2", + "line_item_uid": "line_item_uid8", + "reference_id": "reference_id6", + "buyer_payment_instrument_ids": [ + "buyer_payment_instrument_ids4", + "buyer_payment_instrument_ids5" + ] +} +``` + diff --git a/legacy/doc/models/gift-card-activity-redeem-status.md b/legacy/doc/models/gift-card-activity-redeem-status.md new file mode 100644 index 000000000..ea411fbed --- /dev/null +++ b/legacy/doc/models/gift-card-activity-redeem-status.md @@ -0,0 +1,19 @@ + +# Gift Card Activity Redeem Status + +Indicates the status of a [gift card](../../doc/models/gift-card.md) 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. + +## Enumeration + +`GiftCardActivityRedeemStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `PENDING` | The gift card redemption is pending. `PENDING` is a temporary status that applies when a
gift card is redeemed from Square Point of Sale or another Square product. A `PENDING` status is updated to
`COMPLETED` if the payment is captured or `CANCELED` if the authorization is voided. | +| `COMPLETED` | The gift card redemption is completed. | +| `CANCELED` | The gift card redemption is canceled. A redemption is canceled if the authorization
on the gift card is voided. | + diff --git a/legacy/doc/models/gift-card-activity-redeem.md b/legacy/doc/models/gift-card-activity-redeem.md new file mode 100644 index 000000000..5e3ddcc8e --- /dev/null +++ b/legacy/doc/models/gift-card-activity-redeem.md @@ -0,0 +1,32 @@ + +# Gift Card Activity Redeem + +Represents details about a `REDEEM` [gift card activity type](../../doc/models/gift-card-activity-type.md). + +## Structure + +`GiftCardActivityRedeem` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `amountMoney` | [`Money`](../../doc/models/money.md) | Required | 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. | +| `paymentId` | `string \| undefined` | Optional | The ID of the payment that represents the gift card redemption. Square populates this field
if the payment was processed by Square. | +| `referenceId` | `string \| null \| undefined` | Optional | 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` | [`string \| undefined`](../../doc/models/gift-card-activity-redeem-status.md) | Optional | Indicates the status of a [gift card](../../doc/models/gift-card.md) 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. | + +## Example (as JSON) + +```json +{ + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "payment_id": "payment_id4", + "reference_id": "reference_id2", + "status": "COMPLETED" +} +``` + diff --git a/legacy/doc/models/gift-card-activity-refund.md b/legacy/doc/models/gift-card-activity-refund.md new file mode 100644 index 000000000..b65f53218 --- /dev/null +++ b/legacy/doc/models/gift-card-activity-refund.md @@ -0,0 +1,32 @@ + +# Gift Card Activity Refund + +Represents details about a `REFUND` [gift card activity type](../../doc/models/gift-card-activity-type.md). + +## Structure + +`GiftCardActivityRefund` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `redeemActivityId` | `string \| null \| undefined` | Optional | 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. | +| `amountMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `referenceId` | `string \| null \| undefined` | Optional | A client-specified ID that associates the gift card activity with an entity in another system. | +| `paymentId` | `string \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "redeem_activity_id": "redeem_activity_id4", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "reference_id": "reference_id8", + "payment_id": "payment_id4" +} +``` + diff --git a/legacy/doc/models/gift-card-activity-transfer-balance-from.md b/legacy/doc/models/gift-card-activity-transfer-balance-from.md new file mode 100644 index 000000000..7efef2e6c --- /dev/null +++ b/legacy/doc/models/gift-card-activity-transfer-balance-from.md @@ -0,0 +1,28 @@ + +# Gift Card Activity Transfer Balance From + +Represents details about a `TRANSFER_BALANCE_FROM` [gift card activity type](../../doc/models/gift-card-activity-type.md). + +## Structure + +`GiftCardActivityTransferBalanceFrom` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `transferToGiftCardId` | `string` | Required | The ID of the gift card to which the specified amount was transferred. | +| `amountMoney` | [`Money`](../../doc/models/money.md) | Required | 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. | + +## Example (as JSON) + +```json +{ + "transfer_to_gift_card_id": "transfer_to_gift_card_id0", + "amount_money": { + "amount": 186, + "currency": "AUD" + } +} +``` + diff --git a/legacy/doc/models/gift-card-activity-transfer-balance-to.md b/legacy/doc/models/gift-card-activity-transfer-balance-to.md new file mode 100644 index 000000000..e8de2695a --- /dev/null +++ b/legacy/doc/models/gift-card-activity-transfer-balance-to.md @@ -0,0 +1,28 @@ + +# Gift Card Activity Transfer Balance To + +Represents details about a `TRANSFER_BALANCE_TO` [gift card activity type](../../doc/models/gift-card-activity-type.md). + +## Structure + +`GiftCardActivityTransferBalanceTo` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `transferFromGiftCardId` | `string` | Required | The ID of the gift card from which the specified amount was transferred. | +| `amountMoney` | [`Money`](../../doc/models/money.md) | Required | 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. | + +## Example (as JSON) + +```json +{ + "transfer_from_gift_card_id": "transfer_from_gift_card_id6", + "amount_money": { + "amount": 186, + "currency": "AUD" + } +} +``` + diff --git a/legacy/doc/models/gift-card-activity-type.md b/legacy/doc/models/gift-card-activity-type.md new file mode 100644 index 000000000..53df15bc2 --- /dev/null +++ b/legacy/doc/models/gift-card-activity-type.md @@ -0,0 +1,29 @@ + +# Gift Card Activity Type + +Indicates the type of [gift card activity](../../doc/models/gift-card-activity.md). + +## Enumeration + +`GiftCardActivityType` + +## Fields + +| Name | Description | +| --- | --- | +| `ACTIVATE` | Activated a gift card with a balance. When a gift card is activated, Square changes
the gift card state from `PENDING` to `ACTIVE`. A gift card must be in the `ACTIVE` state
to be used for other balance-changing activities. | +| `LOAD` | Loaded a gift card with additional funds. | +| `REDEEM` | Redeemed a gift card for a purchase. | +| `CLEAR_BALANCE` | Set the balance of a gift card to zero. | +| `DEACTIVATE` | Permanently blocked a gift card from balance-changing activities. | +| `ADJUST_INCREMENT` | Added money to a gift card outside of a typical `ACTIVATE`, `LOAD`, or `REFUND` activity flow. | +| `ADJUST_DECREMENT` | Deducted money from a gift card outside of a typical `REDEEM` activity flow. | +| `REFUND` | Added money to a gift card from a refunded transaction. A `REFUND` activity might be linked to
a Square payment, depending on how the payment and refund are processed. For example:

- A payment processed by Square can be refunded to a `PENDING` or `ACTIVE` gift card using the Square
Seller Dashboard, Square Point of Sale, or Refunds API.
- A payment processed using a custom processing system can be refunded to the same gift card. | +| `UNLINKED_ACTIVITY_REFUND` | Added money to a gift card from a refunded transaction that was processed using a custom payment
processing system and not linked to the gift card. | +| `IMPORT` | Imported a third-party gift card with a balance. `IMPORT` activities are managed
by Square and cannot be created using the Gift Card Activities API. | +| `BLOCK` | Temporarily blocked a gift card from balance-changing activities. `BLOCK` activities
are managed by Square and cannot be created using the Gift Card Activities API. | +| `UNBLOCK` | Unblocked a gift card, which enables it to resume balance-changing activities. `UNBLOCK`
activities are managed by Square and cannot be created using the Gift Card Activities API. | +| `IMPORT_REVERSAL` | Reversed the import of a third-party gift card, which sets the gift card state to
`PENDING` and clears the balance. `IMPORT_REVERSAL` activities are managed by Square and
cannot be created using the Gift Card Activities API. | +| `TRANSFER_BALANCE_FROM` | Deducted money from a gift card as the result of a transfer to the balance of another gift card.
`TRANSFER_BALANCE_FROM` activities are managed by Square and cannot be created using the Gift Card Activities API. | +| `TRANSFER_BALANCE_TO` | Added money to a gift card as the result of a transfer from the balance of another gift card.
`TRANSFER_BALANCE_TO` activities are managed by Square and cannot be created using the Gift Card Activities API. | + diff --git a/legacy/doc/models/gift-card-activity-unblock-reason.md b/legacy/doc/models/gift-card-activity-unblock-reason.md new file mode 100644 index 000000000..11ccbda8b --- /dev/null +++ b/legacy/doc/models/gift-card-activity-unblock-reason.md @@ -0,0 +1,15 @@ + +# Gift Card Activity Unblock Reason + +Indicates the reason for unblocking a [gift card](../../doc/models/gift-card.md). + +## Enumeration + +`GiftCardActivityUnblockReason` + +## Fields + +| Name | Description | +| --- | --- | +| `CHARGEBACK_UNBLOCK` | The gift card is unblocked because a chargeback was ruled in favor of the seller. | + diff --git a/legacy/doc/models/gift-card-activity-unblock.md b/legacy/doc/models/gift-card-activity-unblock.md new file mode 100644 index 000000000..c2e830af5 --- /dev/null +++ b/legacy/doc/models/gift-card-activity-unblock.md @@ -0,0 +1,23 @@ + +# Gift Card Activity Unblock + +Represents details about an `UNBLOCK` [gift card activity type](../../doc/models/gift-card-activity-type.md). + +## Structure + +`GiftCardActivityUnblock` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `reason` | `string` | Required, Constant | Indicates the reason for unblocking a [gift card](../../doc/models/gift-card.md).
**Default**: `'CHARGEBACK_UNBLOCK'` | + +## Example (as JSON) + +```json +{ + "reason": "CHARGEBACK_UNBLOCK" +} +``` + diff --git a/legacy/doc/models/gift-card-activity-unlinked-activity-refund.md b/legacy/doc/models/gift-card-activity-unlinked-activity-refund.md new file mode 100644 index 000000000..1fcfb1a43 --- /dev/null +++ b/legacy/doc/models/gift-card-activity-unlinked-activity-refund.md @@ -0,0 +1,30 @@ + +# Gift Card Activity Unlinked Activity Refund + +Represents details about an `UNLINKED_ACTIVITY_REFUND` [gift card activity type](../../doc/models/gift-card-activity-type.md). + +## Structure + +`GiftCardActivityUnlinkedActivityRefund` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `amountMoney` | [`Money`](../../doc/models/money.md) | Required | 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. | +| `referenceId` | `string \| null \| undefined` | Optional | A client-specified ID that associates the gift card activity with an entity in another system. | +| `paymentId` | `string \| undefined` | Optional | The ID of the refunded payment. This field is not used starting in Square version 2022-06-16. | + +## Example (as JSON) + +```json +{ + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "reference_id": "reference_id8", + "payment_id": "payment_id0" +} +``` + diff --git a/legacy/doc/models/gift-card-activity.md b/legacy/doc/models/gift-card-activity.md new file mode 100644 index 000000000..feaeec7eb --- /dev/null +++ b/legacy/doc/models/gift-card-activity.md @@ -0,0 +1,55 @@ + +# Gift Card Activity + +Represents an action performed on a [gift card](../../doc/models/gift-card.md) 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. + +## Structure + +`GiftCardActivity` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | The Square-assigned ID of the gift card activity. | +| `type` | [`string`](../../doc/models/gift-card-activity-type.md) | Required | Indicates the type of [gift card activity](../../doc/models/gift-card-activity.md). | +| `locationId` | `string` | Required | The ID of the [business location](entity:Location) where the activity occurred. | +| `createdAt` | `string \| undefined` | Optional | The timestamp when the gift card activity was created, in RFC 3339 format. | +| `giftCardId` | `string \| null \| undefined` | Optional | The gift card ID. When creating a gift card activity, `gift_card_id` is not required if
`gift_card_gan` is specified. | +| `giftCardGan` | `string \| null \| undefined` | Optional | The gift card account number (GAN). When creating a gift card activity, `gift_card_gan`
is not required if `gift_card_id` is specified. | +| `giftCardBalanceMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `loadActivityDetails` | [`GiftCardActivityLoad \| undefined`](../../doc/models/gift-card-activity-load.md) | Optional | Represents details about a `LOAD` [gift card activity type](../../doc/models/gift-card-activity-type.md). | +| `activateActivityDetails` | [`GiftCardActivityActivate \| undefined`](../../doc/models/gift-card-activity-activate.md) | Optional | Represents details about an `ACTIVATE` [gift card activity type](../../doc/models/gift-card-activity-type.md). | +| `redeemActivityDetails` | [`GiftCardActivityRedeem \| undefined`](../../doc/models/gift-card-activity-redeem.md) | Optional | Represents details about a `REDEEM` [gift card activity type](../../doc/models/gift-card-activity-type.md). | +| `clearBalanceActivityDetails` | [`GiftCardActivityClearBalance \| undefined`](../../doc/models/gift-card-activity-clear-balance.md) | Optional | Represents details about a `CLEAR_BALANCE` [gift card activity type](../../doc/models/gift-card-activity-type.md). | +| `deactivateActivityDetails` | [`GiftCardActivityDeactivate \| undefined`](../../doc/models/gift-card-activity-deactivate.md) | Optional | Represents details about a `DEACTIVATE` [gift card activity type](../../doc/models/gift-card-activity-type.md). | +| `adjustIncrementActivityDetails` | [`GiftCardActivityAdjustIncrement \| undefined`](../../doc/models/gift-card-activity-adjust-increment.md) | Optional | Represents details about an `ADJUST_INCREMENT` [gift card activity type](../../doc/models/gift-card-activity-type.md). | +| `adjustDecrementActivityDetails` | [`GiftCardActivityAdjustDecrement \| undefined`](../../doc/models/gift-card-activity-adjust-decrement.md) | Optional | Represents details about an `ADJUST_DECREMENT` [gift card activity type](../../doc/models/gift-card-activity-type.md). | +| `refundActivityDetails` | [`GiftCardActivityRefund \| undefined`](../../doc/models/gift-card-activity-refund.md) | Optional | Represents details about a `REFUND` [gift card activity type](../../doc/models/gift-card-activity-type.md). | +| `unlinkedActivityRefundActivityDetails` | [`GiftCardActivityUnlinkedActivityRefund \| undefined`](../../doc/models/gift-card-activity-unlinked-activity-refund.md) | Optional | Represents details about an `UNLINKED_ACTIVITY_REFUND` [gift card activity type](../../doc/models/gift-card-activity-type.md). | +| `importActivityDetails` | [`GiftCardActivityImport \| undefined`](../../doc/models/gift-card-activity-import.md) | Optional | Represents details about an `IMPORT` [gift card activity type](../../doc/models/gift-card-activity-type.md).
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`. | +| `blockActivityDetails` | [`GiftCardActivityBlock \| undefined`](../../doc/models/gift-card-activity-block.md) | Optional | Represents details about a `BLOCK` [gift card activity type](../../doc/models/gift-card-activity-type.md). | +| `unblockActivityDetails` | [`GiftCardActivityUnblock \| undefined`](../../doc/models/gift-card-activity-unblock.md) | Optional | Represents details about an `UNBLOCK` [gift card activity type](../../doc/models/gift-card-activity-type.md). | +| `importReversalActivityDetails` | [`GiftCardActivityImportReversal \| undefined`](../../doc/models/gift-card-activity-import-reversal.md) | Optional | Represents details about an `IMPORT_REVERSAL` [gift card activity type](../../doc/models/gift-card-activity-type.md). | +| `transferBalanceToActivityDetails` | [`GiftCardActivityTransferBalanceTo \| undefined`](../../doc/models/gift-card-activity-transfer-balance-to.md) | Optional | Represents details about a `TRANSFER_BALANCE_TO` [gift card activity type](../../doc/models/gift-card-activity-type.md). | +| `transferBalanceFromActivityDetails` | [`GiftCardActivityTransferBalanceFrom \| undefined`](../../doc/models/gift-card-activity-transfer-balance-from.md) | Optional | Represents details about a `TRANSFER_BALANCE_FROM` [gift card activity type](../../doc/models/gift-card-activity-type.md). | + +## Example (as JSON) + +```json +{ + "id": "id8", + "type": "REDEEM", + "location_id": "location_id2", + "created_at": "created_at6", + "gift_card_id": "gift_card_id6", + "gift_card_gan": "gift_card_gan4", + "gift_card_balance_money": { + "amount": 82, + "currency": "IRR" + } +} +``` + diff --git a/legacy/doc/models/gift-card-gan-source.md b/legacy/doc/models/gift-card-gan-source.md new file mode 100644 index 000000000..f58aa0936 --- /dev/null +++ b/legacy/doc/models/gift-card-gan-source.md @@ -0,0 +1,17 @@ + +# Gift Card GAN Source + +Indicates the source that generated the gift card +account number (GAN). + +## Enumeration + +`GiftCardGANSource` + +## Fields + +| Name | Description | +| --- | --- | +| `SQUARE` | The GAN is generated by Square. | +| `OTHER` | The GAN is provided by a non-Square system. For more information, see
[Custom GANs](https://developer.squareup.com/docs/gift-cards/using-gift-cards-api#custom-gans) or
[Third-party gift cards](https://developer.squareup.com/docs/gift-cards/using-gift-cards-api#third-party-gift-cards). | + diff --git a/legacy/doc/models/gift-card-status.md b/legacy/doc/models/gift-card-status.md new file mode 100644 index 000000000..7a364e5ae --- /dev/null +++ b/legacy/doc/models/gift-card-status.md @@ -0,0 +1,18 @@ + +# Gift Card Status + +Indicates the gift card state. + +## Enumeration + +`GiftCardStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `ACTIVE` | The gift card is active and can be used as a payment source. | +| `DEACTIVATED` | Any activity that changes the gift card balance is permanently forbidden. | +| `BLOCKED` | Any activity that changes the gift card balance is temporarily forbidden. | +| `PENDING` | The gift card is pending activation.
This is the initial state when a gift card is created. Typically, you'll call
[CreateGiftCardActivity](../../doc/api/gift-card-activities.md#create-gift-card-activity) to create an
`ACTIVATE` activity that activates the gift card with an initial balance before first use. | + diff --git a/legacy/doc/models/gift-card-type.md b/legacy/doc/models/gift-card-type.md new file mode 100644 index 000000000..fff0b7b80 --- /dev/null +++ b/legacy/doc/models/gift-card-type.md @@ -0,0 +1,16 @@ + +# Gift Card Type + +Indicates the gift card type. + +## Enumeration + +`GiftCardType` + +## Fields + +| Name | Description | +| --- | --- | +| `PHYSICAL` | A plastic gift card. | +| `DIGITAL` | A digital gift card. | + diff --git a/legacy/doc/models/gift-card.md b/legacy/doc/models/gift-card.md new file mode 100644 index 000000000..581f33fee --- /dev/null +++ b/legacy/doc/models/gift-card.md @@ -0,0 +1,38 @@ + +# Gift Card + +Represents a Square gift card. + +## Structure + +`GiftCard` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | The Square-assigned ID of the gift card. | +| `type` | [`string`](../../doc/models/gift-card-type.md) | Required | Indicates the gift card type. | +| `ganSource` | [`string \| undefined`](../../doc/models/gift-card-gan-source.md) | Optional | Indicates the source that generated the gift card
account number (GAN). | +| `state` | [`string \| undefined`](../../doc/models/gift-card-status.md) | Optional | Indicates the gift card state. | +| `balanceMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `gan` | `string \| null \| undefined` | Optional | The gift card account number (GAN). Buyers can use the GAN to make purchases or check
the gift card balance. | +| `createdAt` | `string \| undefined` | Optional | 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. | +| `customerIds` | `string[] \| undefined` | Optional | The IDs of the [customer profiles](entity:Customer) to whom this gift card is linked. | + +## Example (as JSON) + +```json +{ + "id": "id0", + "type": "PHYSICAL", + "gan_source": "SQUARE", + "state": "ACTIVE", + "balance_money": { + "amount": 146, + "currency": "BBD" + }, + "gan": "gan6" +} +``` + diff --git a/legacy/doc/models/inventory-adjustment-group.md b/legacy/doc/models/inventory-adjustment-group.md new file mode 100644 index 000000000..817ea15ee --- /dev/null +++ b/legacy/doc/models/inventory-adjustment-group.md @@ -0,0 +1,27 @@ + +# Inventory Adjustment Group + +## Structure + +`InventoryAdjustmentGroup` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | A unique ID generated by Square for the
`InventoryAdjustmentGroup`.
**Constraints**: *Maximum Length*: `100` | +| `rootAdjustmentId` | `string \| undefined` | Optional | The inventory adjustment of the composed variation.
**Constraints**: *Maximum Length*: `100` | +| `fromState` | [`string \| undefined`](../../doc/models/inventory-state.md) | Optional | Indicates the state of a tracked item quantity in the lifecycle of goods. | +| `toState` | [`string \| undefined`](../../doc/models/inventory-state.md) | Optional | Indicates the state of a tracked item quantity in the lifecycle of goods. | + +## Example (as JSON) + +```json +{ + "id": "id4", + "root_adjustment_id": "root_adjustment_id4", + "from_state": "WASTE", + "to_state": "RESERVED_FOR_SALE" +} +``` + diff --git a/legacy/doc/models/inventory-adjustment.md b/legacy/doc/models/inventory-adjustment.md new file mode 100644 index 000000000..1ae9b88f5 --- /dev/null +++ b/legacy/doc/models/inventory-adjustment.md @@ -0,0 +1,46 @@ + +# Inventory Adjustment + +Represents a change in state or quantity of product inventory at a +particular time and location. + +## Structure + +`InventoryAdjustment` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | A unique ID generated by Square for the
`InventoryAdjustment`.
**Constraints**: *Maximum Length*: `100` | +| `referenceId` | `string \| null \| undefined` | Optional | An optional ID provided by the application to tie the
`InventoryAdjustment` to an external
system.
**Constraints**: *Maximum Length*: `255` | +| `fromState` | [`string \| undefined`](../../doc/models/inventory-state.md) | Optional | Indicates the state of a tracked item quantity in the lifecycle of goods. | +| `toState` | [`string \| undefined`](../../doc/models/inventory-state.md) | Optional | Indicates the state of a tracked item quantity in the lifecycle of goods. | +| `locationId` | `string \| null \| undefined` | Optional | The Square-generated ID of the [Location](entity:Location) where the related
quantity of items is being tracked.
**Constraints**: *Maximum Length*: `100` | +| `catalogObjectId` | `string \| null \| undefined` | Optional | The Square-generated ID of the
[CatalogObject](entity:CatalogObject) being tracked.
**Constraints**: *Maximum Length*: `100` | +| `catalogObjectType` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `14` | +| `quantity` | `string \| null \| undefined` | Optional | The number of items affected by the adjustment as a decimal string.
Can support up to 5 digits after the decimal point.
**Constraints**: *Maximum Length*: `26` | +| `totalPriceMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `occurredAt` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `34` | +| `createdAt` | `string \| undefined` | Optional | An RFC 3339-formatted timestamp that indicates when the inventory adjustment is received.
**Constraints**: *Maximum Length*: `34` | +| `source` | [`SourceApplication \| undefined`](../../doc/models/source-application.md) | Optional | Represents information about the application used to generate a change. | +| `employeeId` | `string \| null \| undefined` | Optional | The Square-generated ID of the [Employee](entity:Employee) responsible for the
inventory adjustment.
**Constraints**: *Maximum Length*: `100` | +| `teamMemberId` | `string \| null \| undefined` | Optional | The Square-generated ID of the [Team Member](entity:TeamMember) responsible for the
inventory adjustment.
**Constraints**: *Maximum Length*: `100` | +| `transactionId` | `string \| undefined` | Optional | The Square-generated ID of the [Transaction](entity:Transaction) that
caused the adjustment. Only relevant for payment-related state
transitions.
**Constraints**: *Maximum Length*: `255` | +| `refundId` | `string \| undefined` | Optional | The Square-generated ID of the [Refund](entity:Refund) that
caused the adjustment. Only relevant for refund-related state
transitions.
**Constraints**: *Maximum Length*: `255` | +| `purchaseOrderId` | `string \| undefined` | Optional | The Square-generated ID of the purchase order that caused the
adjustment. Only relevant for state transitions from the Square for Retail
app.
**Constraints**: *Maximum Length*: `100` | +| `goodsReceiptId` | `string \| undefined` | Optional | The Square-generated ID of the goods receipt that caused the
adjustment. Only relevant for state transitions from the Square for Retail
app.
**Constraints**: *Maximum Length*: `100` | +| `adjustmentGroup` | [`InventoryAdjustmentGroup \| undefined`](../../doc/models/inventory-adjustment-group.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "id": "id6", + "reference_id": "reference_id6", + "from_state": "WASTE", + "to_state": "RESERVED_FOR_SALE", + "location_id": "location_id0" +} +``` + diff --git a/legacy/doc/models/inventory-alert-type.md b/legacy/doc/models/inventory-alert-type.md new file mode 100644 index 000000000..0d9e9d474 --- /dev/null +++ b/legacy/doc/models/inventory-alert-type.md @@ -0,0 +1,16 @@ + +# Inventory Alert Type + +Indicates whether Square should alert the merchant when the inventory quantity of a CatalogItemVariation is low. + +## Enumeration + +`InventoryAlertType` + +## Fields + +| Name | Description | +| --- | --- | +| `NONE` | The variation does not display an alert. | +| `LOW_QUANTITY` | The variation generates an alert when its quantity is low. | + diff --git a/legacy/doc/models/inventory-change-type.md b/legacy/doc/models/inventory-change-type.md new file mode 100644 index 000000000..bc4f17b52 --- /dev/null +++ b/legacy/doc/models/inventory-change-type.md @@ -0,0 +1,17 @@ + +# Inventory Change Type + +Indicates how the inventory change was applied to a tracked product quantity. + +## Enumeration + +`InventoryChangeType` + +## Fields + +| Name | Description | +| --- | --- | +| `PHYSICAL_COUNT` | The change occurred as part of a physical count update. | +| `ADJUSTMENT` | The change occurred as part of the normal lifecycle of goods
(e.g., as an inventory adjustment). | +| `TRANSFER` | The change occurred as part of an inventory transfer. | + diff --git a/legacy/doc/models/inventory-change.md b/legacy/doc/models/inventory-change.md new file mode 100644 index 000000000..6d0bad1e7 --- /dev/null +++ b/legacy/doc/models/inventory-change.md @@ -0,0 +1,64 @@ + +# Inventory Change + +Represents a single physical count, inventory, adjustment, or transfer +that is part of the history of inventory changes for a particular +[CatalogObject](../../doc/models/catalog-object.md) instance. + +## Structure + +`InventoryChange` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `type` | [`string \| undefined`](../../doc/models/inventory-change-type.md) | Optional | Indicates how the inventory change was applied to a tracked product quantity. | +| `physicalCount` | [`InventoryPhysicalCount \| undefined`](../../doc/models/inventory-physical-count.md) | Optional | 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. | +| `adjustment` | [`InventoryAdjustment \| undefined`](../../doc/models/inventory-adjustment.md) | Optional | Represents a change in state or quantity of product inventory at a
particular time and location. | +| `transfer` | [`InventoryTransfer \| undefined`](../../doc/models/inventory-transfer.md) | Optional | Represents the transfer of a quantity of product inventory at a
particular time from one location to another. | +| `measurementUnit` | [`CatalogMeasurementUnit \| undefined`](../../doc/models/catalog-measurement-unit.md) | Optional | Represents the unit used to measure a `CatalogItemVariation` and
specifies the precision for decimal quantities. | +| `measurementUnitId` | `string \| undefined` | Optional | The ID of the [CatalogMeasurementUnit](entity:CatalogMeasurementUnit) object representing the catalog measurement unit associated with the inventory change. | + +## Example (as JSON) + +```json +{ + "type": "ADJUSTMENT", + "physical_count": { + "id": "id2", + "reference_id": "reference_id0", + "catalog_object_id": "catalog_object_id6", + "catalog_object_type": "catalog_object_type6", + "state": "SUPPORTED_BY_NEWER_VERSION" + }, + "adjustment": { + "id": "id4", + "reference_id": "reference_id2", + "from_state": "IN_TRANSIT_TO", + "to_state": "SOLD", + "location_id": "location_id8" + }, + "transfer": { + "id": "id8", + "reference_id": "reference_id6", + "state": "RESERVED_FOR_SALE", + "from_location_id": "from_location_id0", + "to_location_id": "to_location_id0" + }, + "measurement_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 184 + } +} +``` + diff --git a/legacy/doc/models/inventory-count.md b/legacy/doc/models/inventory-count.md new file mode 100644 index 000000000..95fdda729 --- /dev/null +++ b/legacy/doc/models/inventory-count.md @@ -0,0 +1,35 @@ + +# Inventory Count + +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. + +## Structure + +`InventoryCount` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `catalogObjectId` | `string \| null \| undefined` | Optional | The Square-generated ID of the
[CatalogObject](entity:CatalogObject) being tracked.
**Constraints**: *Maximum Length*: `100` | +| `catalogObjectType` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `14` | +| `state` | [`string \| undefined`](../../doc/models/inventory-state.md) | Optional | Indicates the state of a tracked item quantity in the lifecycle of goods. | +| `locationId` | `string \| null \| undefined` | Optional | The Square-generated ID of the [Location](entity:Location) where the related
quantity of items is being tracked.
**Constraints**: *Maximum Length*: `100` | +| `quantity` | `string \| null \| undefined` | Optional | The number of items affected by the estimated count as a decimal string.
Can support up to 5 digits after the decimal point.
**Constraints**: *Maximum Length*: `26` | +| `calculatedAt` | `string \| undefined` | Optional | An RFC 3339-formatted timestamp that indicates when the most recent physical count or adjustment affecting
the estimated count is received.
**Constraints**: *Maximum Length*: `34` | +| `isEstimated` | `boolean \| undefined` | Optional | 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](../../doc/api/inventory.md#batch-change-inventory),
[BatchRetrieveInventoryChanges](../../doc/api/inventory.md#batch-retrieve-inventory-changes),
[BatchRetrieveInventoryCounts](../../doc/api/inventory.md#batch-retrieve-inventory-counts), and
[RetrieveInventoryChanges](../../doc/api/inventory.md#retrieve-inventory-changes). | + +## Example (as JSON) + +```json +{ + "catalog_object_id": "catalog_object_id4", + "catalog_object_type": "catalog_object_type4", + "state": "SOLD", + "location_id": "location_id6", + "quantity": "quantity8" +} +``` + diff --git a/legacy/doc/models/inventory-physical-count.md b/legacy/doc/models/inventory-physical-count.md new file mode 100644 index 000000000..65c5abbad --- /dev/null +++ b/legacy/doc/models/inventory-physical-count.md @@ -0,0 +1,41 @@ + +# Inventory Physical Count + +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. + +## Structure + +`InventoryPhysicalCount` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | A unique Square-generated ID for the
[InventoryPhysicalCount](entity:InventoryPhysicalCount).
**Constraints**: *Maximum Length*: `100` | +| `referenceId` | `string \| null \| undefined` | Optional | An optional ID provided by the application to tie the
[InventoryPhysicalCount](entity:InventoryPhysicalCount) to an external
system.
**Constraints**: *Maximum Length*: `255` | +| `catalogObjectId` | `string \| null \| undefined` | Optional | The Square-generated ID of the
[CatalogObject](entity:CatalogObject) being tracked.
**Constraints**: *Maximum Length*: `100` | +| `catalogObjectType` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `14` | +| `state` | [`string \| undefined`](../../doc/models/inventory-state.md) | Optional | Indicates the state of a tracked item quantity in the lifecycle of goods. | +| `locationId` | `string \| null \| undefined` | Optional | The Square-generated ID of the [Location](entity:Location) where the related
quantity of items is being tracked.
**Constraints**: *Maximum Length*: `100` | +| `quantity` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `26` | +| `source` | [`SourceApplication \| undefined`](../../doc/models/source-application.md) | Optional | Represents information about the application used to generate a change. | +| `employeeId` | `string \| null \| undefined` | Optional | The Square-generated ID of the [Employee](entity:Employee) responsible for the
physical count.
**Constraints**: *Maximum Length*: `100` | +| `teamMemberId` | `string \| null \| undefined` | Optional | The Square-generated ID of the [Team Member](entity:TeamMember) responsible for the
physical count.
**Constraints**: *Maximum Length*: `100` | +| `occurredAt` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `34` | +| `createdAt` | `string \| undefined` | Optional | An RFC 3339-formatted timestamp that indicates when the physical count is received.
**Constraints**: *Maximum Length*: `34` | + +## Example (as JSON) + +```json +{ + "id": "id0", + "reference_id": "reference_id8", + "catalog_object_id": "catalog_object_id4", + "catalog_object_type": "catalog_object_type4", + "state": "COMPOSED" +} +``` + diff --git a/legacy/doc/models/inventory-state.md b/legacy/doc/models/inventory-state.md new file mode 100644 index 000000000..a50a22082 --- /dev/null +++ b/legacy/doc/models/inventory-state.md @@ -0,0 +1,30 @@ + +# Inventory State + +Indicates the state of a tracked item quantity in the lifecycle of goods. + +## Enumeration + +`InventoryState` + +## Fields + +| Name | Description | +| --- | --- | +| `CUSTOM` | The related quantity of items are in a custom state. **READ-ONLY**:
the Inventory API cannot move quantities to or from this state. | +| `IN_STOCK` | The related quantity of items are on hand and available for sale. | +| `SOLD` | The related quantity of items were sold as part of an itemized
transaction. Quantities in the `SOLD` state are no longer tracked. | +| `RETURNED_BY_CUSTOMER` | The related quantity of items were returned through the Square Point
of Sale application, but are not yet available for sale. **READ-ONLY**:
the Inventory API cannot move quantities to or from this state. | +| `RESERVED_FOR_SALE` | The related quantity of items are on hand, but not currently
available for sale. **READ-ONLY**: the Inventory API cannot move
quantities to or from this state. | +| `SOLD_ONLINE` | The related quantity of items were sold online. **READ-ONLY**: the
Inventory API cannot move quantities to or from this state. | +| `ORDERED_FROM_VENDOR` | The related quantity of items were ordered from a vendor but not yet
received. **READ-ONLY**: the Inventory API cannot move quantities to or
from this state. | +| `RECEIVED_FROM_VENDOR` | The related quantity of items were received from a vendor but are
not yet available for sale. **READ-ONLY**: the Inventory API cannot move
quantities to or from this state. | +| `IN_TRANSIT_TO` | Replaced by `IN_TRANSIT` to represent quantities
of items that are in transit between locations. | +| `NONE` | A placeholder indicating that the related quantity of items are not
currently tracked in Square. Transferring quantities from the `NONE` state
to a tracked state (e.g., `IN_STOCK`) introduces stock into the system. | +| `WASTE` | The related quantity of items are lost or damaged and cannot be
sold. | +| `UNLINKED_RETURN` | The related quantity of items were returned but not linked to a
previous transaction. Unlinked returns are not tracked in Square.
Transferring a quantity from `UNLINKED_RETURN` to a tracked state (e.g.,
`IN_STOCK`) introduces new stock into the system. | +| `COMPOSED` | The related quantity of items that are part of a composition consisting one or more components. | +| `DECOMPOSED` | The related quantity of items that are part of a component. | +| `SUPPORTED_BY_NEWER_VERSION` | 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. | +| `IN_TRANSIT` | 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. | + diff --git a/legacy/doc/models/inventory-transfer.md b/legacy/doc/models/inventory-transfer.md new file mode 100644 index 000000000..5e4b3e4a5 --- /dev/null +++ b/legacy/doc/models/inventory-transfer.md @@ -0,0 +1,40 @@ + +# Inventory Transfer + +Represents the transfer of a quantity of product inventory at a +particular time from one location to another. + +## Structure + +`InventoryTransfer` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | A unique ID generated by Square for the
`InventoryTransfer`.
**Constraints**: *Maximum Length*: `100` | +| `referenceId` | `string \| null \| undefined` | Optional | An optional ID provided by the application to tie the
`InventoryTransfer` to an external system.
**Constraints**: *Maximum Length*: `255` | +| `state` | [`string \| undefined`](../../doc/models/inventory-state.md) | Optional | Indicates the state of a tracked item quantity in the lifecycle of goods. | +| `fromLocationId` | `string \| null \| undefined` | Optional | The Square-generated ID of the [Location](entity:Location) where the related
quantity of items was tracked before the transfer.
**Constraints**: *Maximum Length*: `100` | +| `toLocationId` | `string \| null \| undefined` | Optional | The Square-generated ID of the [Location](entity:Location) where the related
quantity of items was tracked after the transfer.
**Constraints**: *Maximum Length*: `100` | +| `catalogObjectId` | `string \| null \| undefined` | Optional | The Square-generated ID of the
[CatalogObject](entity:CatalogObject) being tracked.
**Constraints**: *Maximum Length*: `100` | +| `catalogObjectType` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `14` | +| `quantity` | `string \| null \| undefined` | Optional | The number of items affected by the transfer as a decimal string.
Can support up to 5 digits after the decimal point.
**Constraints**: *Maximum Length*: `26` | +| `occurredAt` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `34` | +| `createdAt` | `string \| undefined` | Optional | An RFC 3339-formatted timestamp that indicates when Square
received the transfer request.
**Constraints**: *Maximum Length*: `34` | +| `source` | [`SourceApplication \| undefined`](../../doc/models/source-application.md) | Optional | Represents information about the application used to generate a change. | +| `employeeId` | `string \| null \| undefined` | Optional | The Square-generated ID of the [Employee](entity:Employee) responsible for the
inventory transfer.
**Constraints**: *Maximum Length*: `100` | +| `teamMemberId` | `string \| null \| undefined` | Optional | The Square-generated ID of the [Team Member](entity:TeamMember) responsible for the
inventory transfer.
**Constraints**: *Maximum Length*: `100` | + +## Example (as JSON) + +```json +{ + "id": "id8", + "reference_id": "reference_id4", + "state": "ORDERED_FROM_VENDOR", + "from_location_id": "from_location_id0", + "to_location_id": "to_location_id0" +} +``` + diff --git a/legacy/doc/models/invoice-accepted-payment-methods.md b/legacy/doc/models/invoice-accepted-payment-methods.md new file mode 100644 index 000000000..19a4550d8 --- /dev/null +++ b/legacy/doc/models/invoice-accepted-payment-methods.md @@ -0,0 +1,31 @@ + +# Invoice Accepted Payment Methods + +The payment methods that customers can use to pay an [invoice](../../doc/models/invoice.md) on the Square-hosted invoice payment page. + +## Structure + +`InvoiceAcceptedPaymentMethods` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `card` | `boolean \| null \| undefined` | Optional | Indicates whether credit card or debit card payments are accepted. The default value is `false`. | +| `squareGiftCard` | `boolean \| null \| undefined` | Optional | Indicates whether Square gift card payments are accepted. The default value is `false`. | +| `bankAccount` | `boolean \| null \| undefined` | Optional | Indicates whether ACH bank transfer payments are accepted. The default value is `false`. | +| `buyNowPayLater` | `boolean \| null \| undefined` | Optional | 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). | +| `cashAppPay` | `boolean \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "card": false, + "square_gift_card": false, + "bank_account": false, + "buy_now_pay_later": false, + "cash_app_pay": false +} +``` + diff --git a/legacy/doc/models/invoice-attachment.md b/legacy/doc/models/invoice-attachment.md new file mode 100644 index 000000000..35462e614 --- /dev/null +++ b/legacy/doc/models/invoice-attachment.md @@ -0,0 +1,33 @@ + +# Invoice Attachment + +Represents a file attached to an [invoice](../../doc/models/invoice.md). + +## Structure + +`InvoiceAttachment` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | The Square-assigned ID of the attachment. | +| `filename` | `string \| undefined` | Optional | The file name of the attachment, which is displayed on the invoice. | +| `description` | `string \| undefined` | Optional | The description of the attachment, which is displayed on the invoice.
This field maps to the seller-defined **Message** field. | +| `filesize` | `number \| undefined` | Optional | The file size of the attachment in bytes. | +| `hash` | `string \| undefined` | Optional | The MD5 hash that was generated from the file contents. | +| `mimeType` | `string \| undefined` | Optional | The mime type of the attachment.
The following mime types are supported:
image/gif, image/jpeg, image/png, image/tiff, image/bmp, application/pdf. | +| `uploadedAt` | `string \| undefined` | Optional | The timestamp when the attachment was uploaded, in RFC 3339 format. | + +## Example (as JSON) + +```json +{ + "id": "id4", + "filename": "filename6", + "description": "description6", + "filesize": 164, + "hash": "hash0" +} +``` + diff --git a/legacy/doc/models/invoice-automatic-payment-source.md b/legacy/doc/models/invoice-automatic-payment-source.md new file mode 100644 index 000000000..5f6f256db --- /dev/null +++ b/legacy/doc/models/invoice-automatic-payment-source.md @@ -0,0 +1,17 @@ + +# Invoice Automatic Payment Source + +Indicates the automatic payment method for an [invoice payment request](../../doc/models/invoice-payment-request.md). + +## Enumeration + +`InvoiceAutomaticPaymentSource` + +## Fields + +| Name | Description | +| --- | --- | +| `NONE` | An automatic payment is not configured for the payment request. | +| `CARD_ON_FILE` | Use a card on file as the automatic payment method. On the due date, Square charges the card
for the amount of the payment request.

For `CARD_ON_FILE` payments, the invoice delivery method must be `EMAIL` and `card_id` must be
specified for the payment request before the invoice can be published. | +| `BANK_ON_FILE` | Use a bank account on file as the automatic payment method. On the due date, Square charges the bank
account for the amount of the payment request if the buyer has approved the payment. The buyer receives a
request to approve the payment when the invoice is sent or the invoice is updated.

This payment method applies only to invoices that sellers create in the Seller Dashboard or other
Square product. The bank account is provided by the customer during the payment flow.

You cannot set `BANK_ON_FILE` as a payment method using the Invoices API, but you can change a `BANK_ON_FILE`
payment method to `NONE` or `CARD_ON_FILE`. For `BANK_ON_FILE` payments, the invoice delivery method must be `EMAIL`. | + diff --git a/legacy/doc/models/invoice-custom-field-placement.md b/legacy/doc/models/invoice-custom-field-placement.md new file mode 100644 index 000000000..4d4ceb92f --- /dev/null +++ b/legacy/doc/models/invoice-custom-field-placement.md @@ -0,0 +1,17 @@ + +# Invoice Custom Field Placement + +Indicates where to render a custom field on the Square-hosted invoice page and in emailed or PDF +copies of the invoice. + +## Enumeration + +`InvoiceCustomFieldPlacement` + +## Fields + +| Name | Description | +| --- | --- | +| `ABOVE_LINE_ITEMS` | Render the custom field above the invoice line items. | +| `BELOW_LINE_ITEMS` | Render the custom field below the invoice line items. | + diff --git a/legacy/doc/models/invoice-custom-field.md b/legacy/doc/models/invoice-custom-field.md new file mode 100644 index 000000000..254a89780 --- /dev/null +++ b/legacy/doc/models/invoice-custom-field.md @@ -0,0 +1,31 @@ + +# Invoice Custom Field + +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). + +## Structure + +`InvoiceCustomField` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `label` | `string \| null \| undefined` | Optional | The label or title of the custom field. This field is required for a custom field.
**Constraints**: *Maximum Length*: `30` | +| `value` | `string \| null \| undefined` | Optional | The text of the custom field. If omitted, only the label is rendered.
**Constraints**: *Maximum Length*: `2000` | +| `placement` | [`string \| undefined`](../../doc/models/invoice-custom-field-placement.md) | Optional | Indicates where to render a custom field on the Square-hosted invoice page and in emailed or PDF
copies of the invoice. | + +## Example (as JSON) + +```json +{ + "label": "label6", + "value": "value8", + "placement": "ABOVE_LINE_ITEMS" +} +``` + diff --git a/legacy/doc/models/invoice-delivery-method.md b/legacy/doc/models/invoice-delivery-method.md new file mode 100644 index 000000000..80ade49a6 --- /dev/null +++ b/legacy/doc/models/invoice-delivery-method.md @@ -0,0 +1,17 @@ + +# Invoice Delivery Method + +Indicates how Square delivers the [invoice](../../doc/models/invoice.md) to the customer. + +## Enumeration + +`InvoiceDeliveryMethod` + +## Fields + +| Name | Description | +| --- | --- | +| `EMAIL` | Directs Square to send invoices, reminders, and receipts to the customer using email. | +| `SHARE_MANUALLY` | Directs Square to take no action on the invoice. In this case, the seller
or application developer follows up with the customer for payment. For example,
a seller might collect a payment in the Seller Dashboard or Point of Sale (POS) application.
The seller might also share the URL of the Square-hosted invoice page (`public_url`) with the customer to request payment. | +| `SMS` | Directs Square to send invoices and receipts to the customer using SMS (text message).

You cannot set `SMS` as a delivery method using the Invoices API, but you can change an `SMS` delivery method to `EMAIL` or `SHARE_MANUALLY`. | + diff --git a/legacy/doc/models/invoice-filter.md b/legacy/doc/models/invoice-filter.md new file mode 100644 index 000000000..605299b0c --- /dev/null +++ b/legacy/doc/models/invoice-filter.md @@ -0,0 +1,32 @@ + +# Invoice Filter + +Describes query filters to apply. + +## Structure + +`InvoiceFilter` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationIds` | `string[]` | Required | Limits the search to the specified locations. A location is required.
In the current implementation, only one location can be specified. | +| `customerIds` | `string[] \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "location_ids": [ + "location_ids0", + "location_ids1", + "location_ids2" + ], + "customer_ids": [ + "customer_ids3", + "customer_ids2" + ] +} +``` + diff --git a/legacy/doc/models/invoice-payment-reminder-status.md b/legacy/doc/models/invoice-payment-reminder-status.md new file mode 100644 index 000000000..cc78753c4 --- /dev/null +++ b/legacy/doc/models/invoice-payment-reminder-status.md @@ -0,0 +1,17 @@ + +# Invoice Payment Reminder Status + +The status of a payment request reminder. + +## Enumeration + +`InvoicePaymentReminderStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `PENDING` | The reminder will be sent on the `relative_scheduled_date` (if the invoice is published). | +| `NOT_APPLICABLE` | The reminder is not applicable and is not sent. The following are examples
of when reminders are not applicable and are not sent:

- You schedule a reminder to be sent before the invoice is published.
- The invoice is configured with multiple payment requests and a payment request reminder
is configured to be sent after the next payment request `due_date`.
- Two reminders (for different payment requests) are configured to be sent on the
same date. Therefore, only one reminder is sent.
- You configure a reminder to be sent on the date that the invoice is scheduled to be sent.
- The payment request is already paid.
- The invoice status is `CANCELED` or `FAILED`. | +| `SENT` | The reminder is sent. | + diff --git a/legacy/doc/models/invoice-payment-reminder.md b/legacy/doc/models/invoice-payment-reminder.md new file mode 100644 index 000000000..50c2c0d38 --- /dev/null +++ b/legacy/doc/models/invoice-payment-reminder.md @@ -0,0 +1,33 @@ + +# Invoice Payment Reminder + +Describes a payment request reminder (automatic notification) that Square sends +to the customer. You configure a reminder relative to the payment request +`due_date`. + +## Structure + +`InvoicePaymentReminder` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string \| undefined` | Optional | A Square-assigned ID that uniquely identifies the reminder within the
`InvoicePaymentRequest`. | +| `relativeScheduledDays` | `number \| null \| undefined` | Optional | 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`.
**Constraints**: `>= -32767`, `<= 32767` | +| `message` | `string \| null \| undefined` | Optional | The reminder message.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `1000` | +| `status` | [`string \| undefined`](../../doc/models/invoice-payment-reminder-status.md) | Optional | The status of a payment request reminder. | +| `sentAt` | `string \| undefined` | Optional | If sent, the timestamp when the reminder was sent, in RFC 3339 format. | + +## Example (as JSON) + +```json +{ + "uid": "uid6", + "relative_scheduled_days": 198, + "message": "message4", + "status": "SENT", + "sent_at": "sent_at6" +} +``` + diff --git a/legacy/doc/models/invoice-payment-request.md b/legacy/doc/models/invoice-payment-request.md new file mode 100644 index 000000000..5f88d0e93 --- /dev/null +++ b/legacy/doc/models/invoice-payment-request.md @@ -0,0 +1,47 @@ + +# Invoice Payment Request + +Represents a payment request for an [invoice](../../doc/models/invoice.md). 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). + +## Structure + +`InvoicePaymentRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string \| null \| undefined` | Optional | The Square-generated ID of the payment request in an [invoice](entity:Invoice).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | +| `requestMethod` | [`string \| undefined`](../../doc/models/invoice-request-method.md) | Optional | 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. | +| `requestType` | [`string \| undefined`](../../doc/models/invoice-request-type.md) | Optional | 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). | +| `dueDate` | `string \| null \| undefined` | Optional | 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). | +| `fixedAmountRequestedMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `percentageRequested` | `string \| null \| undefined` | Optional | 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. | +| `tippingEnabled` | `boolean \| null \| undefined` | Optional | 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`. | +| `automaticPaymentSource` | [`string \| undefined`](../../doc/models/invoice-automatic-payment-source.md) | Optional | Indicates the automatic payment method for an [invoice payment request](../../doc/models/invoice-payment-request.md). | +| `cardId` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | +| `reminders` | [`InvoicePaymentReminder[] \| null \| undefined`](../../doc/models/invoice-payment-reminder.md) | Optional | A list of one or more reminders to send for the payment request. | +| `computedAmountMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `totalCompletedAmountMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `roundingAdjustmentIncludedMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "uid": "uid0", + "request_method": "SHARE_MANUALLY", + "request_type": "DEPOSIT", + "due_date": "due_date8", + "fixed_amount_requested_money": { + "amount": 162, + "currency": "JOD" + } +} +``` + diff --git a/legacy/doc/models/invoice-query.md b/legacy/doc/models/invoice-query.md new file mode 100644 index 000000000..e1daf637e --- /dev/null +++ b/legacy/doc/models/invoice-query.md @@ -0,0 +1,36 @@ + +# Invoice Query + +Describes query criteria for searching invoices. + +## Structure + +`InvoiceQuery` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `filter` | [`InvoiceFilter`](../../doc/models/invoice-filter.md) | Required | Describes query filters to apply. | +| `sort` | [`InvoiceSort \| undefined`](../../doc/models/invoice-sort.md) | Optional | Identifies the sort field and sort order. | + +## Example (as JSON) + +```json +{ + "filter": { + "location_ids": [ + "location_ids4" + ], + "customer_ids": [ + "customer_ids3", + "customer_ids2" + ] + }, + "sort": { + "field": "field2", + "order": "DESC" + } +} +``` + diff --git a/legacy/doc/models/invoice-recipient-tax-ids.md b/legacy/doc/models/invoice-recipient-tax-ids.md new file mode 100644 index 000000000..70e7cd280 --- /dev/null +++ b/legacy/doc/models/invoice-recipient-tax-ids.md @@ -0,0 +1,25 @@ + +# Invoice Recipient Tax Ids + +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). + +## Structure + +`InvoiceRecipientTaxIds` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `euVat` | `string \| undefined` | Optional | The EU VAT identification number for the invoice recipient. For example, `IE3426675K`. | + +## Example (as JSON) + +```json +{ + "eu_vat": "eu_vat8" +} +``` + diff --git a/legacy/doc/models/invoice-recipient.md b/legacy/doc/models/invoice-recipient.md new file mode 100644 index 000000000..a9d5c2f25 --- /dev/null +++ b/legacy/doc/models/invoice-recipient.md @@ -0,0 +1,45 @@ + +# Invoice Recipient + +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. + +## Structure + +`InvoiceRecipient` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customerId` | `string \| null \| undefined` | Optional | The ID of the customer. This is the customer profile ID that
you provide when creating a draft invoice.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | +| `givenName` | `string \| undefined` | Optional | The recipient's given (that is, first) name. | +| `familyName` | `string \| undefined` | Optional | The recipient's family (that is, last) name. | +| `emailAddress` | `string \| undefined` | Optional | The recipient's email address. | +| `address` | [`Address \| undefined`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | +| `phoneNumber` | `string \| undefined` | Optional | The recipient's phone number. | +| `companyName` | `string \| undefined` | Optional | The name of the recipient's company. | +| `taxIds` | [`InvoiceRecipientTaxIds \| undefined`](../../doc/models/invoice-recipient-tax-ids.md) | Optional | 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). | + +## Example (as JSON) + +```json +{ + "customer_id": "customer_id8", + "given_name": "given_name2", + "family_name": "family_name4", + "email_address": "email_address8", + "address": { + "address_line_1": "address_line_16", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "locality": "locality6", + "sublocality": "sublocality6" + } +} +``` + diff --git a/legacy/doc/models/invoice-request-method.md b/legacy/doc/models/invoice-request-method.md new file mode 100644 index 000000000..412d716b0 --- /dev/null +++ b/legacy/doc/models/invoice-request-method.md @@ -0,0 +1,24 @@ + +# Invoice Request Method + +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. + +## Enumeration + +`InvoiceRequestMethod` + +## Fields + +| Name | Description | +| --- | --- | +| `EMAIL` | Directs Square to send invoices, reminders, and receipts to the customer using email.
Square sends the invoice after it is published (either immediately or at the `scheduled_at`
time, if specified in the [invoice](entity:Invoice)). | +| `CHARGE_CARD_ON_FILE` | Directs Square to charge the card on file on the `due_date` specified in the payment request
and to use email to send invoices, reminders, and receipts. | +| `SHARE_MANUALLY` | Directs Square to take no specific action on the invoice. In this case, the seller
(or the application developer) follows up with the customer for payment. For example,
a seller might collect a payment in the Seller Dashboard or use the Point of Sale (POS) application.
The seller might also share the URL of the Square-hosted invoice page (`public_url`) with the customer requesting payment. | +| `CHARGE_BANK_ON_FILE` | Directs Square to charge the customer's bank account on file and to use email to send invoices, reminders, and receipts.
The customer must approve the payment.

The bank on file payment method applies only to invoices that sellers create in the Seller Dashboard or other
Square product. The bank account is provided by the customer during the payment flow. You
cannot set `CHARGE_BANK_ON_FILE` as a request method using the Invoices API. | +| `SMS` | Directs Square to send invoices and receipts to the customer using SMS (text message). Square sends the invoice
after it is published (either immediately or at the `scheduled_at` time, if specified in the [invoice](entity:Invoice)).

You cannot set `SMS` as a request method using the Invoices API. | +| `SMS_CHARGE_CARD_ON_FILE` | Directs Square to charge the card on file on the `due_date` specified in the payment request and to
use SMS (text message) to send invoices and receipts.

You cannot set `SMS_CHARGE_CARD_ON_FILE` as a request method using the Invoices API. | +| `SMS_CHARGE_BANK_ON_FILE` | Directs Square to charge the customer's bank account on file and to use SMS (text message) to send invoices and receipts.
The customer must approve the payment.

The bank on file payment method applies only to invoices that sellers create in the Seller Dashboard
or other Square product. The bank account is provided by the customer during the payment flow.
You cannot set `SMS_CHARGE_BANK_ON_FILE` as a request method using the Invoices API. | + diff --git a/legacy/doc/models/invoice-request-type.md b/legacy/doc/models/invoice-request-type.md new file mode 100644 index 000000000..2f9a9e886 --- /dev/null +++ b/legacy/doc/models/invoice-request-type.md @@ -0,0 +1,18 @@ + +# Invoice Request Type + +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). + +## Enumeration + +`InvoiceRequestType` + +## Fields + +| Name | Description | +| --- | --- | +| `BALANCE` | A request for a balance payment. The balance amount is computed as follows:

- If the invoice specifies only a balance payment request, the balance amount is the
total amount of the associated order.
- If the invoice also specifies a deposit request, the balance amount is the amount
remaining after the deposit.

`INSTALLMENT` and `BALANCE` payment requests are not allowed in the same invoice. | +| `DEPOSIT` | A request for a deposit payment. You have the option of specifying
an exact amount or a percentage of the total order amount. If you request a deposit,
it must be due before any other payment requests. | +| `INSTALLMENT` | A request for an installment payment. Installments allow buyers to pay the invoice over time. Installments can optionally be combined with a deposit.

Adding `INSTALLMENT` payment requests to an invoice requires an
[Invoices Plus subscription](https://developer.squareup.com/docs/invoices-api/overview#invoices-plus-subscription). | + diff --git a/legacy/doc/models/invoice-sort-field.md b/legacy/doc/models/invoice-sort-field.md new file mode 100644 index 000000000..6e3bbf54a --- /dev/null +++ b/legacy/doc/models/invoice-sort-field.md @@ -0,0 +1,15 @@ + +# Invoice Sort Field + +The field to use for sorting. + +## Enumeration + +`InvoiceSortField` + +## Fields + +| Name | Description | +| --- | --- | +| `INVOICE_SORT_DATE` | The field works as follows:

- If the invoice is a draft, it uses the invoice `created_at` date.
- If the invoice is scheduled for publication, it uses the `scheduled_at` date.
- If the invoice is published, it uses the invoice publication date. | + diff --git a/legacy/doc/models/invoice-sort.md b/legacy/doc/models/invoice-sort.md new file mode 100644 index 000000000..0ed4b96f4 --- /dev/null +++ b/legacy/doc/models/invoice-sort.md @@ -0,0 +1,25 @@ + +# Invoice Sort + +Identifies the sort field and sort order. + +## Structure + +`InvoiceSort` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `field` | `string` | Required, Constant | The field to use for sorting.
**Default**: `'INVOICE_SORT_DATE'` | +| `order` | [`string \| undefined`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | + +## Example (as JSON) + +```json +{ + "field": "INVOICE_SORT_DATE", + "order": "DESC" +} +``` + diff --git a/legacy/doc/models/invoice-status.md b/legacy/doc/models/invoice-status.md new file mode 100644 index 000000000..ec13bb977 --- /dev/null +++ b/legacy/doc/models/invoice-status.md @@ -0,0 +1,24 @@ + +# Invoice Status + +Indicates the status of an invoice. + +## Enumeration + +`InvoiceStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `DRAFT` | The invoice is a draft. You must publish a draft invoice before Square can process it.
A draft invoice has no `public_url`, so it is not available to customers. | +| `UNPAID` | The invoice is published but not yet paid. | +| `SCHEDULED` | The invoice is scheduled to be processed. On the scheduled date,
Square sends the invoice, initiates an automatic payment, or takes no action, depending on
the delivery method and payment request settings. Square also sets the invoice status to the
appropriate state: `UNPAID`, `PAID`, `PARTIALLY_PAID`, or `PAYMENT_PENDING`. | +| `PARTIALLY_PAID` | A partial payment is received for the invoice. | +| `PAID` | The customer paid the invoice in full. | +| `PARTIALLY_REFUNDED` | The invoice is paid (or partially paid) and some but not all the amount paid is
refunded. | +| `REFUNDED` | The full amount that the customer paid for the invoice is refunded. | +| `CANCELED` | The invoice is canceled. Square no longer requests payments from the customer.
The `public_url` page remains and is accessible, but it displays the invoice
as canceled and does not accept payment. | +| `FAILED` | Square canceled the invoice due to suspicious activity. | +| `PAYMENT_PENDING` | A payment on the invoice was initiated but has not yet been processed.

When in this state, invoices cannot be updated and other payments cannot be initiated. | + diff --git a/legacy/doc/models/invoice.md b/legacy/doc/models/invoice.md new file mode 100644 index 000000000..1e7686af8 --- /dev/null +++ b/legacy/doc/models/invoice.md @@ -0,0 +1,63 @@ + +# Invoice + +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). + +## Structure + +`Invoice` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | The Square-assigned ID of the invoice. | +| `version` | `number \| undefined` | Optional | The Square-assigned version number, which is incremented each time an update is committed to the invoice. | +| `locationId` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | +| `orderId` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | +| `primaryRecipient` | [`InvoiceRecipient \| undefined`](../../doc/models/invoice-recipient.md) | Optional | 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. | +| `paymentRequests` | [`InvoicePaymentRequest[] \| null \| undefined`](../../doc/models/invoice-payment-request.md) | Optional | 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). | +| `deliveryMethod` | [`string \| undefined`](../../doc/models/invoice-delivery-method.md) | Optional | Indicates how Square delivers the [invoice](../../doc/models/invoice.md) to the customer. | +| `invoiceNumber` | `string \| null \| undefined` | Optional | 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).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `191` | +| `title` | `string \| null \| undefined` | Optional | The title of the invoice, which is displayed on the invoice.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | +| `description` | `string \| null \| undefined` | Optional | The description of the invoice, which is displayed on the invoice.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `65536` | +| `scheduledAt` | `string \| null \| undefined` | Optional | 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. | +| `publicUrl` | `string \| undefined` | Optional | The URL of the Square-hosted invoice page.
After you publish the invoice using the `PublishInvoice` endpoint, Square hosts the invoice
page and returns the page URL in the response. | +| `nextPaymentAmountMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `status` | [`string \| undefined`](../../doc/models/invoice-status.md) | Optional | Indicates the status of an invoice. | +| `timezone` | `string \| undefined` | Optional | 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). | +| `createdAt` | `string \| undefined` | Optional | The timestamp when the invoice was created, in RFC 3339 format. | +| `updatedAt` | `string \| undefined` | Optional | The timestamp when the invoice was last updated, in RFC 3339 format. | +| `acceptedPaymentMethods` | [`InvoiceAcceptedPaymentMethods \| undefined`](../../doc/models/invoice-accepted-payment-methods.md) | Optional | The payment methods that customers can use to pay an [invoice](../../doc/models/invoice.md) on the Square-hosted invoice payment page. | +| `customFields` | [`InvoiceCustomField[] \| null \| undefined`](../../doc/models/invoice-custom-field.md) | Optional | 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 | +| `subscriptionId` | `string \| undefined` | Optional | The ID of the [subscription](entity:Subscription) associated with the invoice.
This field is present only on subscription billing invoices. | +| `saleOrServiceDate` | `string \| null \| undefined` | Optional | 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. | +| `paymentConditions` | `string \| null \| undefined` | Optional | **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.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `2000` | +| `storePaymentMethodEnabled` | `boolean \| null \| undefined` | Optional | 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` | [`InvoiceAttachment[] \| undefined`](../../doc/models/invoice-attachment.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "id": "id0", + "version": 224, + "location_id": "location_id4", + "order_id": "order_id4", + "primary_recipient": { + "customer_id": "customer_id2", + "given_name": "given_name6", + "family_name": "family_name8", + "email_address": "email_address2", + "address": { + "address_line_1": "address_line_16", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "locality": "locality6", + "sublocality": "sublocality6" + } + } +} +``` + diff --git a/legacy/doc/models/item-variation-location-overrides.md b/legacy/doc/models/item-variation-location-overrides.md new file mode 100644 index 000000000..44a05020f --- /dev/null +++ b/legacy/doc/models/item-variation-location-overrides.md @@ -0,0 +1,37 @@ + +# Item Variation Location Overrides + +Price and inventory alerting overrides for a `CatalogItemVariation` at a specific `Location`. + +## Structure + +`ItemVariationLocationOverrides` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string \| null \| undefined` | Optional | The ID of the `Location`. This can include locations that are deactivated. | +| `priceMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `pricingType` | [`string \| undefined`](../../doc/models/catalog-pricing-type.md) | Optional | Indicates whether the price of a CatalogItemVariation should be entered manually at the time of sale. | +| `trackInventory` | `boolean \| null \| undefined` | Optional | If `true`, inventory tracking is active for the `CatalogItemVariation` at this `Location`. | +| `inventoryAlertType` | [`string \| undefined`](../../doc/models/inventory-alert-type.md) | Optional | Indicates whether Square should alert the merchant when the inventory quantity of a CatalogItemVariation is low. | +| `inventoryAlertThreshold` | `bigint \| null \| undefined` | Optional | 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. | +| `soldOut` | `boolean \| undefined` | Optional | 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`. | +| `soldOutValidUntil` | `string \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "location_id": "location_id6", + "price_money": { + "amount": 202, + "currency": "GTQ" + }, + "pricing_type": "FIXED_PRICING", + "track_inventory": false, + "inventory_alert_type": "NONE" +} +``` + diff --git a/legacy/doc/models/job-assignment-pay-type.md b/legacy/doc/models/job-assignment-pay-type.md new file mode 100644 index 000000000..f093e47e5 --- /dev/null +++ b/legacy/doc/models/job-assignment-pay-type.md @@ -0,0 +1,17 @@ + +# Job Assignment Pay Type + +Enumerates the possible pay types that a job can be assigned. + +## Enumeration + +`JobAssignmentPayType` + +## Fields + +| Name | Description | +| --- | --- | +| `NONE` | The job does not have a defined pay type. | +| `HOURLY` | The job pays an hourly rate. | +| `SALARY` | The job pays an annual salary. | + diff --git a/legacy/doc/models/job-assignment.md b/legacy/doc/models/job-assignment.md new file mode 100644 index 000000000..81ef7bfc3 --- /dev/null +++ b/legacy/doc/models/job-assignment.md @@ -0,0 +1,40 @@ + +# Job Assignment + +Represents a job assigned to a [team member](../../doc/models/team-member.md), including the compensation the team +member earns for the job. Job assignments are listed in the team member's [wage setting](../../doc/models/wage-setting.md). + +## Structure + +`JobAssignment` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `jobTitle` | `string \| null \| undefined` | Optional | The title of the job. | +| `payType` | [`string`](../../doc/models/job-assignment-pay-type.md) | Required | Enumerates the possible pay types that a job can be assigned. | +| `hourlyRate` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `annualRate` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `weeklyHours` | `number \| null \| undefined` | Optional | The planned hours per week for the job. Set if the job `PayType` is `SALARY`. | +| `jobId` | `string \| null \| undefined` | Optional | The ID of the [job](../../doc/models/job.md). | + +## Example (as JSON) + +```json +{ + "job_title": "job_title6", + "pay_type": "NONE", + "hourly_rate": { + "amount": 172, + "currency": "LAK" + }, + "annual_rate": { + "amount": 232, + "currency": "NIO" + }, + "weekly_hours": 120, + "job_id": "job_id8" +} +``` + diff --git a/legacy/doc/models/job.md b/legacy/doc/models/job.md new file mode 100644 index 000000000..2fb338726 --- /dev/null +++ b/legacy/doc/models/job.md @@ -0,0 +1,34 @@ + +# Job + +Represents a job that can be assigned to [team members](../../doc/models/team-member.md). This object defines the +job's title and tip eligibility. Compensation is defined in a [job assignment](../../doc/models/job-assignment.md) +in a team member's wage setting. + +## Structure + +`Job` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | **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` | `string \| null \| undefined` | Optional | The title of the job.
**Constraints**: *Maximum Length*: `150` | +| `isTipEligible` | `boolean \| null \| undefined` | Optional | Indicates whether team members can earn tips for the job. | +| `createdAt` | `string \| undefined` | Optional | The timestamp when the job was created, in RFC 3339 format. | +| `updatedAt` | `string \| undefined` | Optional | The timestamp when the job was last updated, in RFC 3339 format. | +| `version` | `number \| undefined` | Optional | **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. | + +## Example (as JSON) + +```json +{ + "id": "id6", + "title": "title2", + "is_tip_eligible": false, + "created_at": "created_at4", + "updated_at": "updated_at2" +} +``` + diff --git a/legacy/doc/models/link-customer-to-gift-card-request.md b/legacy/doc/models/link-customer-to-gift-card-request.md new file mode 100644 index 000000000..2ee612b80 --- /dev/null +++ b/legacy/doc/models/link-customer-to-gift-card-request.md @@ -0,0 +1,23 @@ + +# Link Customer to Gift Card Request + +A request to link a customer to a gift card. + +## Structure + +`LinkCustomerToGiftCardRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customerId` | `string` | Required | The ID of the customer to link to the gift card.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `191` | + +## Example (as JSON) + +```json +{ + "customer_id": "GKY0FZ3V717AH8Q2D821PNT2ZW" +} +``` + diff --git a/legacy/doc/models/link-customer-to-gift-card-response.md b/legacy/doc/models/link-customer-to-gift-card-response.md new file mode 100644 index 000000000..b956ec790 --- /dev/null +++ b/legacy/doc/models/link-customer-to-gift-card-response.md @@ -0,0 +1,47 @@ + +# Link Customer to Gift Card Response + +A response that contains the linked `GiftCard` object. If the request resulted in errors, +the response contains a set of `Error` objects. + +## Structure + +`LinkCustomerToGiftCardResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `giftCard` | [`GiftCard \| undefined`](../../doc/models/gift-card.md) | Optional | Represents a Square gift card. | + +## Example (as JSON) + +```json +{ + "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" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/list-bank-accounts-request.md b/legacy/doc/models/list-bank-accounts-request.md new file mode 100644 index 000000000..adf510a31 --- /dev/null +++ b/legacy/doc/models/list-bank-accounts-request.md @@ -0,0 +1,28 @@ + +# List Bank Accounts Request + +Request object for fetching all `BankAccount` +objects linked to a account. + +## Structure + +`ListBankAccountsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `cursor` | `string \| null \| undefined` | Optional | 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` | `number \| null \| undefined` | Optional | 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. | +| `locationId` | `string \| null \| undefined` | Optional | Location ID. You can specify this optional filter
to retrieve only the linked bank accounts belonging to a specific location. | + +## Example (as JSON) + +```json +{ + "cursor": "cursor8", + "limit": 182, + "location_id": "location_id2" +} +``` + diff --git a/legacy/doc/models/list-bank-accounts-response.md b/legacy/doc/models/list-bank-accounts-response.md new file mode 100644 index 000000000..3cc1682ba --- /dev/null +++ b/legacy/doc/models/list-bank-accounts-response.md @@ -0,0 +1,73 @@ + +# List Bank Accounts Response + +Response object returned by ListBankAccounts. + +## Structure + +`ListBankAccountsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | +| `bankAccounts` | [`BankAccount[] \| undefined`](../../doc/models/bank-account.md) | Optional | List of BankAccounts associated with this account. | +| `cursor` | `string \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "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, + "secondary_bank_identification_number": "secondary_bank_identification_number0", + "debit_mandate_reference_id": "debit_mandate_reference_id4", + "reference_id": "reference_id8", + "fingerprint": "fingerprint6" + }, + { + "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, + "secondary_bank_identification_number": "secondary_bank_identification_number0", + "debit_mandate_reference_id": "debit_mandate_reference_id4", + "reference_id": "reference_id8", + "fingerprint": "fingerprint6" + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "cursor": "cursor2" +} +``` + diff --git a/legacy/doc/models/list-booking-custom-attribute-definitions-request.md b/legacy/doc/models/list-booking-custom-attribute-definitions-request.md new file mode 100644 index 000000000..c939b9125 --- /dev/null +++ b/legacy/doc/models/list-booking-custom-attribute-definitions-request.md @@ -0,0 +1,25 @@ + +# List Booking Custom Attribute Definitions Request + +Represents a [ListBookingCustomAttributeDefinitions](../../doc/api/booking-custom-attributes.md#list-booking-custom-attribute-definitions) request. + +## Structure + +`ListBookingCustomAttributeDefinitionsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `limit` | `number \| null \| undefined` | Optional | 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).
**Constraints**: `>= 1`, `<= 100` | +| `cursor` | `string \| null \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "limit": 98, + "cursor": "cursor6" +} +``` + diff --git a/legacy/doc/models/list-booking-custom-attribute-definitions-response.md b/legacy/doc/models/list-booking-custom-attribute-definitions-response.md new file mode 100644 index 000000000..5237ec7b9 --- /dev/null +++ b/legacy/doc/models/list-booking-custom-attribute-definitions-response.md @@ -0,0 +1,56 @@ + +# List Booking Custom Attribute Definitions Response + +Represents a [ListBookingCustomAttributeDefinitions](../../doc/api/booking-custom-attributes.md#list-booking-custom-attribute-definitions) 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`. + +## Structure + +`ListBookingCustomAttributeDefinitionsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttributeDefinitions` | [`CustomAttributeDefinition[] \| undefined`](../../doc/models/custom-attribute-definition.md) | Optional | The retrieved custom attribute definitions. If no custom attribute definitions are found,
Square returns an empty object (`{}`). | +| `cursor` | `string \| undefined` | Optional | 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` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "cursor": "YEk4UPbUEsu8MUV0xouO5hCiFcD9T5ztB6UWEJq5vZnqBFmoBEi0j1j6HWYTFGMRre4p7T5wAQBj3Th1NX3XgBFcQVEVsIxUQ2NsbwjRitfoEZDml9uxxQXepowyRvCuSThHPbJSn7M7wInl3x8XypQF9ahVVQXegJ0CxEKc0SBH", + "custom_attribute_definitions": [ + { + "created_at": "2022-11-16T15:27:30Z", + "description": "Update the description as desired.", + "key": "favoriteShampoo", + "name": "Favorite shampoo", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "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": { + "key1": "val1", + "key2": "val2" + }, + "updated_at": "2022-11-16T15:49:05Z", + "version": 1, + "visibility": "VISIBILITY_HIDDEN" + } + ], + "errors": [] +} +``` + diff --git a/legacy/doc/models/list-booking-custom-attributes-request.md b/legacy/doc/models/list-booking-custom-attributes-request.md new file mode 100644 index 000000000..787757e68 --- /dev/null +++ b/legacy/doc/models/list-booking-custom-attributes-request.md @@ -0,0 +1,27 @@ + +# List Booking Custom Attributes Request + +Represents a [ListBookingCustomAttributes](../../doc/api/booking-custom-attributes.md#list-booking-custom-attributes) request. + +## Structure + +`ListBookingCustomAttributesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `limit` | `number \| null \| undefined` | Optional | 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).
**Constraints**: `>= 1`, `<= 100` | +| `cursor` | `string \| null \| undefined` | Optional | 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). | +| `withDefinitions` | `boolean \| null \| undefined` | Optional | 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`. | + +## Example (as JSON) + +```json +{ + "limit": 254, + "cursor": "cursor8", + "with_definitions": false +} +``` + diff --git a/legacy/doc/models/list-booking-custom-attributes-response.md b/legacy/doc/models/list-booking-custom-attributes-response.md new file mode 100644 index 000000000..4f02a78c0 --- /dev/null +++ b/legacy/doc/models/list-booking-custom-attributes-response.md @@ -0,0 +1,81 @@ + +# List Booking Custom Attributes Response + +Represents a [ListBookingCustomAttributes](../../doc/api/booking-custom-attributes.md#list-booking-custom-attributes) 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`. + +## Structure + +`ListBookingCustomAttributesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttributes` | [`CustomAttribute[] \| undefined`](../../doc/models/custom-attribute.md) | Optional | 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` | `string \| undefined` | Optional | 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` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "custom_attributes": [ + { + "key": "key8", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 180, + "visibility": "VISIBILITY_HIDDEN", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + { + "key": "key8", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 180, + "visibility": "VISIBILITY_HIDDEN", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + } + ], + "cursor": "cursor0", + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/list-bookings-request.md b/legacy/doc/models/list-bookings-request.md new file mode 100644 index 000000000..a2e3b144f --- /dev/null +++ b/legacy/doc/models/list-bookings-request.md @@ -0,0 +1,31 @@ + +# List Bookings Request + +## Structure + +`ListBookingsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `limit` | `number \| null \| undefined` | Optional | The maximum number of results per page to return in a paged response.
**Constraints**: `>= 1`, `<= 10000` | +| `cursor` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `65536` | +| `customerId` | `string \| null \| undefined` | Optional | The [customer](entity:Customer) for whom to retrieve bookings. If this is not set, bookings for all customers are retrieved.
**Constraints**: *Maximum Length*: `192` | +| `teamMemberId` | `string \| null \| undefined` | Optional | The team member for whom to retrieve bookings. If this is not set, bookings of all members are retrieved.
**Constraints**: *Maximum Length*: `32` | +| `locationId` | `string \| null \| undefined` | Optional | The location for which to retrieve bookings. If this is not set, all locations' bookings are retrieved.
**Constraints**: *Maximum Length*: `32` | +| `startAtMin` | `string \| null \| undefined` | Optional | The RFC 3339 timestamp specifying the earliest of the start time. If this is not set, the current time is used. | +| `startAtMax` | `string \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "limit": 34, + "cursor": "cursor4", + "customer_id": "customer_id0", + "team_member_id": "team_member_id2", + "location_id": "location_id6" +} +``` + diff --git a/legacy/doc/models/list-bookings-response.md b/legacy/doc/models/list-bookings-response.md new file mode 100644 index 000000000..887430b12 --- /dev/null +++ b/legacy/doc/models/list-bookings-response.md @@ -0,0 +1,52 @@ + +# List Bookings Response + +## Structure + +`ListBookingsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `bookings` | [`Booking[] \| undefined`](../../doc/models/booking.md) | Optional | The list of targeted bookings. | +| `cursor` | `string \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `65536` | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "bookings": [ + { + "id": "id4", + "version": 218, + "status": "ACCEPTED", + "created_at": "created_at2", + "updated_at": "updated_at0" + } + ], + "cursor": "cursor6", + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/list-break-types-request.md b/legacy/doc/models/list-break-types-request.md new file mode 100644 index 000000000..f14e782f6 --- /dev/null +++ b/legacy/doc/models/list-break-types-request.md @@ -0,0 +1,27 @@ + +# List Break Types Request + +A request for a filtered set of `BreakType` objects. + +## Structure + +`ListBreakTypesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string \| null \| undefined` | Optional | Filter the returned `BreakType` results to only those that are associated with the
specified location. | +| `limit` | `number \| null \| undefined` | Optional | The maximum number of `BreakType` results to return per page. The number can range between 1
and 200. The default is 200.
**Constraints**: `>= 1`, `<= 200` | +| `cursor` | `string \| null \| undefined` | Optional | A pointer to the next page of `BreakType` results to fetch. | + +## Example (as JSON) + +```json +{ + "location_id": "location_id6", + "limit": 244, + "cursor": "cursor4" +} +``` + diff --git a/legacy/doc/models/list-break-types-response.md b/legacy/doc/models/list-break-types-response.md new file mode 100644 index 000000000..76761436e --- /dev/null +++ b/legacy/doc/models/list-break-types-response.md @@ -0,0 +1,63 @@ + +# List Break Types Response + +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. + +## Structure + +`ListBreakTypesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `breakTypes` | [`BreakType[] \| undefined`](../../doc/models/break-type.md) | Optional | A page of `BreakType` results. | +| `cursor` | `string \| undefined` | Optional | The value supplied in the subsequent request to fetch the next page
of `BreakType` results. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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", + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/list-cards-request.md b/legacy/doc/models/list-cards-request.md new file mode 100644 index 000000000..09ca4b60d --- /dev/null +++ b/legacy/doc/models/list-cards-request.md @@ -0,0 +1,32 @@ + +# List Cards Request + +Retrieves details for a specific Card. Accessible via +HTTP requests at GET https://connect.squareup.com/v2/cards + +## Structure + +`ListCardsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `cursor` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `256` | +| `customerId` | `string \| null \| undefined` | Optional | Limit results to cards associated with the customer supplied.
By default, all cards owned by the merchant are returned. | +| `includeDisabled` | `boolean \| null \| undefined` | Optional | Includes disabled cards.
By default, all enabled cards owned by the merchant are returned. | +| `referenceId` | `string \| null \| undefined` | Optional | Limit results to cards associated with the reference_id supplied. | +| `sortOrder` | [`string \| undefined`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | + +## Example (as JSON) + +```json +{ + "cursor": "cursor6", + "customer_id": "customer_id8", + "include_disabled": false, + "reference_id": "reference_id8", + "sort_order": "DESC" +} +``` + diff --git a/legacy/doc/models/list-cards-response.md b/legacy/doc/models/list-cards-response.md new file mode 100644 index 000000000..91da1745f --- /dev/null +++ b/legacy/doc/models/list-cards-response.md @@ -0,0 +1,64 @@ + +# List Cards Response + +Defines the fields that are included in the response body of +a request to the [ListCards](../../doc/api/cards.md#list-cards) endpoint. + +Note: if there are errors processing the request, the card field will not be +present. + +## Structure + +`ListCardsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | +| `cards` | [`Card[] \| undefined`](../../doc/models/card.md) | Optional | The requested list of `Card`s. | +| `cursor` | `string \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "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", + "id": "ccof:uIbfJXhXETSP197M3GB", + "last_4": "1111", + "merchant_id": "6SSW7HV8K2ST5", + "prepaid_type": "NOT_PREPAID", + "reference_id": "user-id-1", + "version": 1 + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "cursor": "cursor6" +} +``` + diff --git a/legacy/doc/models/list-cash-drawer-shift-events-request.md b/legacy/doc/models/list-cash-drawer-shift-events-request.md new file mode 100644 index 000000000..0e99af8c4 --- /dev/null +++ b/legacy/doc/models/list-cash-drawer-shift-events-request.md @@ -0,0 +1,25 @@ + +# List Cash Drawer Shift Events Request + +## Structure + +`ListCashDrawerShiftEventsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string` | Required | The ID of the location to list cash drawer shifts for.
**Constraints**: *Minimum Length*: `1` | +| `limit` | `number \| null \| undefined` | Optional | Number of resources to be returned in a page of results (200 by
default, 1000 max).
**Constraints**: `<= 1000` | +| `cursor` | `string \| null \| undefined` | Optional | Opaque cursor for fetching the next page of results. | + +## Example (as JSON) + +```json +{ + "location_id": "location_id8", + "limit": 24, + "cursor": "cursor2" +} +``` + diff --git a/legacy/doc/models/list-cash-drawer-shift-events-response.md b/legacy/doc/models/list-cash-drawer-shift-events-response.md new file mode 100644 index 000000000..a7c2b0b96 --- /dev/null +++ b/legacy/doc/models/list-cash-drawer-shift-events-response.md @@ -0,0 +1,99 @@ + +# List Cash Drawer Shift Events Response + +## Structure + +`ListCashDrawerShiftEventsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `cursor` | `string \| undefined` | Optional | Opaque cursor for fetching the next page. Cursor is not present in
the last page of results. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `cashDrawerShiftEvents` | [`CashDrawerShiftEvent[] \| undefined`](../../doc/models/cash-drawer-shift-event.md) | Optional | All of the events (payments, refunds, etc.) for a cash drawer during
the shift. | + +## Example (as JSON) + +```json +{ + "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": "" + } + ], + "cursor": "cursor8", + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/list-cash-drawer-shifts-request.md b/legacy/doc/models/list-cash-drawer-shifts-request.md new file mode 100644 index 000000000..003caa4a4 --- /dev/null +++ b/legacy/doc/models/list-cash-drawer-shifts-request.md @@ -0,0 +1,31 @@ + +# List Cash Drawer Shifts Request + +## Structure + +`ListCashDrawerShiftsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string` | Required | The ID of the location to query for a list of cash drawer shifts.
**Constraints**: *Minimum Length*: `1` | +| `sortOrder` | [`string \| undefined`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | +| `beginTime` | `string \| null \| undefined` | Optional | The inclusive start time of the query on opened_at, in ISO 8601 format. | +| `endTime` | `string \| null \| undefined` | Optional | The exclusive end date of the query on opened_at, in ISO 8601 format. | +| `limit` | `number \| null \| undefined` | Optional | Number of cash drawer shift events in a page of results (200 by
default, 1000 max).
**Constraints**: `<= 1000` | +| `cursor` | `string \| null \| undefined` | Optional | Opaque cursor for fetching the next page of results. | + +## Example (as JSON) + +```json +{ + "location_id": "location_id6", + "sort_order": "DESC", + "begin_time": "begin_time0", + "end_time": "end_time4", + "limit": 154, + "cursor": "cursor4" +} +``` + diff --git a/legacy/doc/models/list-cash-drawer-shifts-response.md b/legacy/doc/models/list-cash-drawer-shifts-response.md new file mode 100644 index 000000000..559527ef8 --- /dev/null +++ b/legacy/doc/models/list-cash-drawer-shifts-response.md @@ -0,0 +1,59 @@ + +# List Cash Drawer Shifts Response + +## Structure + +`ListCashDrawerShiftsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `cursor` | `string \| undefined` | Optional | Opaque cursor for fetching the next page of results. Cursor is not
present in the last page of results. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `cashDrawerShifts` | [`CashDrawerShiftSummary[] \| undefined`](../../doc/models/cash-drawer-shift-summary.md) | Optional | A collection of CashDrawerShiftSummary objects for shifts that match
the query. | + +## Example (as JSON) + +```json +{ + "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" + } + ], + "cursor": "cursor6", + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/list-catalog-request.md b/legacy/doc/models/list-catalog-request.md new file mode 100644 index 000000000..0689e6646 --- /dev/null +++ b/legacy/doc/models/list-catalog-request.md @@ -0,0 +1,25 @@ + +# List Catalog Request + +## Structure + +`ListCatalogRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `cursor` | `string \| null \| undefined` | Optional | 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` | `string \| null \| undefined` | Optional | 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. | +| `catalogVersion` | `bigint \| null \| undefined` | Optional | 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](../../doc/models/catalog-object.md)s' `version` attribute. If not included, results will be from the
current version of the catalog. | + +## Example (as JSON) + +```json +{ + "cursor": "cursor2", + "types": "types0", + "catalog_version": 254 +} +``` + diff --git a/legacy/doc/models/list-catalog-response.md b/legacy/doc/models/list-catalog-response.md new file mode 100644 index 000000000..c0b8ce1ae --- /dev/null +++ b/legacy/doc/models/list-catalog-response.md @@ -0,0 +1,119 @@ + +# List Catalog Response + +## Structure + +`ListCatalogResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `cursor` | `string \| undefined` | Optional | 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` | [`CatalogObject[] \| undefined`](../../doc/models/catalog-object.md) | Optional | The CatalogObjects returned. | + +## Example (as JSON) + +```json +{ + "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, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] + }, + { + "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, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "cursor": "cursor6" +} +``` + diff --git a/legacy/doc/models/list-customer-custom-attribute-definitions-request.md b/legacy/doc/models/list-customer-custom-attribute-definitions-request.md new file mode 100644 index 000000000..0ee6b61f1 --- /dev/null +++ b/legacy/doc/models/list-customer-custom-attribute-definitions-request.md @@ -0,0 +1,25 @@ + +# List Customer Custom Attribute Definitions Request + +Represents a [ListCustomerCustomAttributeDefinitions](../../doc/api/customer-custom-attributes.md#list-customer-custom-attribute-definitions) request. + +## Structure + +`ListCustomerCustomAttributeDefinitionsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `limit` | `number \| null \| undefined` | Optional | 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).
**Constraints**: `>= 1`, `<= 100` | +| `cursor` | `string \| null \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "limit": 198, + "cursor": "cursor8" +} +``` + diff --git a/legacy/doc/models/list-customer-custom-attribute-definitions-response.md b/legacy/doc/models/list-customer-custom-attribute-definitions-response.md new file mode 100644 index 000000000..451437f2a --- /dev/null +++ b/legacy/doc/models/list-customer-custom-attribute-definitions-response.md @@ -0,0 +1,69 @@ + +# List Customer Custom Attribute Definitions Response + +Represents a [ListCustomerCustomAttributeDefinitions](../../doc/api/customer-custom-attributes.md#list-customer-custom-attribute-definitions) 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`. + +## Structure + +`ListCustomerCustomAttributeDefinitionsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttributeDefinitions` | [`CustomAttributeDefinition[] \| undefined`](../../doc/models/custom-attribute-definition.md) | Optional | The retrieved custom attribute definitions. If no custom attribute definitions are found,
Square returns an empty object (`{}`). | +| `cursor` | `string \| undefined` | Optional | 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` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "cursor": "YEk4UPbUEsu8MUV0xouO5hCiFcD9T5ztB6UWEJq5vZnqBFmoBEi0j1j6HWYTFGMRre4p7T5wAQBj3Th1NX3XgBFcQVEVsIxUQ2NsbwjRitfoEZDml9uxxQXepowyRvCuSThHPbJSn7M7wInl3x8XypQF9ahVVQXegJ0CxEKc0SBH", + "custom_attribute_definitions": [ + { + "created_at": "2022-04-26T15:27:30Z", + "description": "Update the description as desired.", + "key": "favoritemovie", + "name": "Favorite Movie", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "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": { + "key1": "val1", + "key2": "val2" + }, + "updated_at": "2022-04-26T15:49:05Z", + "version": 1, + "visibility": "VISIBILITY_HIDDEN" + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/list-customer-custom-attributes-request.md b/legacy/doc/models/list-customer-custom-attributes-request.md new file mode 100644 index 000000000..3dcc11651 --- /dev/null +++ b/legacy/doc/models/list-customer-custom-attributes-request.md @@ -0,0 +1,27 @@ + +# List Customer Custom Attributes Request + +Represents a [ListCustomerCustomAttributes](../../doc/api/customer-custom-attributes.md#list-customer-custom-attributes) request. + +## Structure + +`ListCustomerCustomAttributesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `limit` | `number \| null \| undefined` | Optional | 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).
**Constraints**: `>= 1`, `<= 100` | +| `cursor` | `string \| null \| undefined` | Optional | 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). | +| `withDefinitions` | `boolean \| null \| undefined` | Optional | 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`. | + +## Example (as JSON) + +```json +{ + "limit": 224, + "cursor": "cursor6", + "with_definitions": false +} +``` + diff --git a/legacy/doc/models/list-customer-custom-attributes-response.md b/legacy/doc/models/list-customer-custom-attributes-response.md new file mode 100644 index 000000000..c41e7eb1f --- /dev/null +++ b/legacy/doc/models/list-customer-custom-attributes-response.md @@ -0,0 +1,106 @@ + +# List Customer Custom Attributes Response + +Represents a [ListCustomerCustomAttributes](../../doc/api/customer-custom-attributes.md#list-customer-custom-attributes) 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`. + +## Structure + +`ListCustomerCustomAttributesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttributes` | [`CustomAttribute[] \| undefined`](../../doc/models/custom-attribute.md) | Optional | 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` | `string \| undefined` | Optional | 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` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "custom_attributes": [ + { + "key": "key8", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 180, + "visibility": "VISIBILITY_HIDDEN", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + { + "key": "key8", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 180, + "visibility": "VISIBILITY_HIDDEN", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + { + "key": "key8", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 180, + "visibility": "VISIBILITY_HIDDEN", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + } + ], + "cursor": "cursor4", + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/list-customer-groups-request.md b/legacy/doc/models/list-customer-groups-request.md new file mode 100644 index 000000000..1a7fded26 --- /dev/null +++ b/legacy/doc/models/list-customer-groups-request.md @@ -0,0 +1,26 @@ + +# List Customer Groups Request + +Defines the query parameters that can be included in a request to the +[ListCustomerGroups](../../doc/api/customer-groups.md#list-customer-groups) endpoint. + +## Structure + +`ListCustomerGroupsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `cursor` | `string \| null \| undefined` | Optional | 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` | `number \| null \| undefined` | Optional | 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).
**Constraints**: `>= 1`, `<= 50` | + +## Example (as JSON) + +```json +{ + "cursor": "cursor4", + "limit": 104 +} +``` + diff --git a/legacy/doc/models/list-customer-groups-response.md b/legacy/doc/models/list-customer-groups-response.md new file mode 100644 index 000000000..6783b6b87 --- /dev/null +++ b/legacy/doc/models/list-customer-groups-response.md @@ -0,0 +1,62 @@ + +# List Customer Groups Response + +Defines the fields that are included in the response body of +a request to the [ListCustomerGroups](../../doc/api/customer-groups.md#list-customer-groups) endpoint. + +Either `errors` or `groups` is present in a given response (never both). + +## Structure + +`ListCustomerGroupsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `groups` | [`CustomerGroup[] \| undefined`](../../doc/models/customer-group.md) | Optional | A list of customer groups belonging to the current seller. | +| `cursor` | `string \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "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" + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "cursor": "cursor0" +} +``` + diff --git a/legacy/doc/models/list-customer-segments-request.md b/legacy/doc/models/list-customer-segments-request.md new file mode 100644 index 000000000..ff4af005b --- /dev/null +++ b/legacy/doc/models/list-customer-segments-request.md @@ -0,0 +1,25 @@ + +# List Customer Segments Request + +Defines the valid parameters for requests to the `ListCustomerSegments` endpoint. + +## Structure + +`ListCustomerSegmentsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `cursor` | `string \| null \| undefined` | Optional | 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` | `number \| null \| undefined` | Optional | 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).
**Constraints**: `>= 1`, `<= 50` | + +## Example (as JSON) + +```json +{ + "cursor": "cursor4", + "limit": 4 +} +``` + diff --git a/legacy/doc/models/list-customer-segments-response.md b/legacy/doc/models/list-customer-segments-response.md new file mode 100644 index 000000000..7ab56799c --- /dev/null +++ b/legacy/doc/models/list-customer-segments-response.md @@ -0,0 +1,73 @@ + +# List Customer Segments Response + +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). + +## Structure + +`ListCustomerSegmentsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `segments` | [`CustomerSegment[] \| undefined`](../../doc/models/customer-segment.md) | Optional | The list of customer segments belonging to the associated Square account. | +| `cursor` | `string \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "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" + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "cursor": "cursor2" +} +``` + diff --git a/legacy/doc/models/list-customers-request.md b/legacy/doc/models/list-customers-request.md new file mode 100644 index 000000000..edd96fe2f --- /dev/null +++ b/legacy/doc/models/list-customers-request.md @@ -0,0 +1,32 @@ + +# List Customers Request + +Defines the query parameters that can be included in a request to the +`ListCustomers` endpoint. + +## Structure + +`ListCustomersRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `cursor` | `string \| null \| undefined` | Optional | 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` | `number \| null \| undefined` | Optional | 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).
**Constraints**: `>= 1`, `<= 100` | +| `sortField` | [`string \| undefined`](../../doc/models/customer-sort-field.md) | Optional | Specifies customer attributes as the sort key to customer profiles returned from a search. | +| `sortOrder` | [`string \| undefined`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | +| `count` | `boolean \| null \| undefined` | Optional | Indicates whether to return the total count of customers in the `count` field of the response.

The default value is `false`. | + +## Example (as JSON) + +```json +{ + "cursor": "cursor6", + "limit": 96, + "sort_field": "DEFAULT", + "sort_order": "DESC", + "count": false +} +``` + diff --git a/legacy/doc/models/list-customers-response.md b/legacy/doc/models/list-customers-response.md new file mode 100644 index 000000000..b47582d7f --- /dev/null +++ b/legacy/doc/models/list-customers-response.md @@ -0,0 +1,98 @@ + +# List Customers Response + +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). + +## Structure + +`ListCustomersResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `customers` | [`Customer[] \| undefined`](../../doc/models/customer.md) | Optional | 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` | `string \| undefined` | Optional | 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` | `bigint \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "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, + "cards": [ + { + "id": "id8", + "card_brand": "DISCOVER", + "last_4": "last_40", + "exp_month": 152, + "exp_year": 144 + }, + { + "id": "id8", + "card_brand": "DISCOVER", + "last_4": "last_40", + "exp_month": 152, + "exp_year": 144 + } + ] + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "cursor": "cursor6", + "count": 184 +} +``` + diff --git a/legacy/doc/models/list-device-codes-request.md b/legacy/doc/models/list-device-codes-request.md new file mode 100644 index 000000000..4cf20d721 --- /dev/null +++ b/legacy/doc/models/list-device-codes-request.md @@ -0,0 +1,31 @@ + +# List Device Codes Request + +## Structure + +`ListDeviceCodesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `cursor` | `string \| null \| undefined` | Optional | 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. | +| `locationId` | `string \| null \| undefined` | Optional | If specified, only returns DeviceCodes of the specified location.
Returns DeviceCodes of all locations if empty. | +| `productType` | [`string \| undefined`](../../doc/models/product-type.md) | Optional | - | +| `status` | [`string[] \| null \| undefined`](../../doc/models/device-code-status.md) | Optional | If specified, returns DeviceCodes with the specified statuses.
Returns DeviceCodes of status `PAIRED` and `UNPAIRED` if empty.
See [DeviceCodeStatus](#type-devicecodestatus) for possible values | + +## Example (as JSON) + +```json +{ + "cursor": "cursor6", + "location_id": "location_id4", + "product_type": "TERMINAL_API", + "status": [ + "UNKNOWN", + "UNPAIRED", + "PAIRED" + ] +} +``` + diff --git a/legacy/doc/models/list-device-codes-response.md b/legacy/doc/models/list-device-codes-response.md new file mode 100644 index 000000000..2ea67ea70 --- /dev/null +++ b/legacy/doc/models/list-device-codes-response.md @@ -0,0 +1,69 @@ + +# List Device Codes Response + +## Structure + +`ListDeviceCodesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `deviceCodes` | [`DeviceCode[] \| undefined`](../../doc/models/device-code.md) | Optional | The queried DeviceCode. | +| `cursor` | `string \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "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", + "device_id": "device_id4" + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "cursor": "cursor6" +} +``` + diff --git a/legacy/doc/models/list-devices-request.md b/legacy/doc/models/list-devices-request.md new file mode 100644 index 000000000..52237ee53 --- /dev/null +++ b/legacy/doc/models/list-devices-request.md @@ -0,0 +1,27 @@ + +# List Devices Request + +## Structure + +`ListDevicesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `cursor` | `string \| null \| undefined` | Optional | 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. | +| `sortOrder` | [`string \| undefined`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | +| `limit` | `number \| null \| undefined` | Optional | The number of results to return in a single page.
**Constraints**: `>= 1`, `<= 100` | +| `locationId` | `string \| null \| undefined` | Optional | If present, only returns devices at the target location. | + +## Example (as JSON) + +```json +{ + "cursor": "cursor0", + "sort_order": "DESC", + "limit": 164, + "location_id": "location_id0" +} +``` + diff --git a/legacy/doc/models/list-devices-response.md b/legacy/doc/models/list-devices-response.md new file mode 100644 index 000000000..a2bfd8aa2 --- /dev/null +++ b/legacy/doc/models/list-devices-response.md @@ -0,0 +1,368 @@ + +# List Devices Response + +## Structure + +`ListDevicesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors that occurred during the request. | +| `devices` | [`Device[] \| undefined`](../../doc/models/device.md) | Optional | The requested list of `Device` objects. | +| `cursor` | `string \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "cursor": "GcXjlV2iaizH7R0fMT6wUDbw6l4otigjzx8XOOspUKHo9EPLRByM", + "devices": [ + { + "attributes": { + "manufacturer": "Square", + "manufacturers_id": "995CS397A6475287", + "merchant_token": "MLCHNZCBWFDZB", + "model": "T2", + "name": "Square Terminal 995", + "type": "TERMINAL", + "updated_at": "2023-09-29T13:04:56.335762883Z", + "version": "5.41.0085" + }, + "components": [ + { + "application_details": { + "application_type": "TERMINAL_API", + "session_location": "LMN2K7S3RTOU3", + "version": "6.25", + "device_code_id": "device_code_id2" + }, + "type": "APPLICATION", + "card_reader_details": { + "version": "version0" + }, + "battery_details": { + "visible_percent": 108, + "external_power": "AVAILABLE_CHARGING" + }, + "wifi_details": { + "active": false, + "ssid": "ssid8", + "ip_address_v4": "ip_address_v42", + "secure_connection": "secure_connection8", + "signal_strength": { + "value": 222 + } + }, + "ethernet_details": { + "active": false, + "ip_address_v4": "ip_address_v42" + } + }, + { + "card_reader_details": { + "version": "3.53.70" + }, + "type": "CARD_READER", + "application_details": { + "application_type": "TERMINAL_API", + "version": "version4", + "session_location": "session_location0", + "device_code_id": "device_code_id2" + }, + "battery_details": { + "visible_percent": 108, + "external_power": "AVAILABLE_CHARGING" + }, + "wifi_details": { + "active": false, + "ssid": "ssid8", + "ip_address_v4": "ip_address_v42", + "secure_connection": "secure_connection8", + "signal_strength": { + "value": 222 + } + }, + "ethernet_details": { + "active": false, + "ip_address_v4": "ip_address_v42" + } + }, + { + "battery_details": { + "external_power": "AVAILABLE_CHARGING", + "visible_percent": 5 + }, + "type": "BATTERY", + "application_details": { + "application_type": "TERMINAL_API", + "version": "version4", + "session_location": "session_location0", + "device_code_id": "device_code_id2" + }, + "card_reader_details": { + "version": "version0" + }, + "wifi_details": { + "active": false, + "ssid": "ssid8", + "ip_address_v4": "ip_address_v42", + "secure_connection": "secure_connection8", + "signal_strength": { + "value": 222 + } + }, + "ethernet_details": { + "active": false, + "ip_address_v4": "ip_address_v42" + } + }, + { + "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" + }, + "application_details": { + "application_type": "TERMINAL_API", + "version": "version4", + "session_location": "session_location0", + "device_code_id": "device_code_id2" + }, + "card_reader_details": { + "version": "version0" + }, + "battery_details": { + "visible_percent": 108, + "external_power": "AVAILABLE_CHARGING" + }, + "ethernet_details": { + "active": false, + "ip_address_v4": "ip_address_v42" + } + }, + { + "ethernet_details": { + "active": false + }, + "type": "ETHERNET", + "application_details": { + "application_type": "TERMINAL_API", + "version": "version4", + "session_location": "session_location0", + "device_code_id": "device_code_id2" + }, + "card_reader_details": { + "version": "version0" + }, + "battery_details": { + "visible_percent": 108, + "external_power": "AVAILABLE_CHARGING" + }, + "wifi_details": { + "active": false, + "ssid": "ssid8", + "ip_address_v4": "ip_address_v42", + "secure_connection": "secure_connection8", + "signal_strength": { + "value": 222 + } + } + } + ], + "id": "device:995CS397A6475287", + "status": { + "category": "AVAILABLE" + } + }, + { + "attributes": { + "manufacturer": "Square", + "manufacturers_id": "995CS234B5493559", + "merchant_token": "MLCHXZCBWFGDW", + "model": "T2", + "name": "Square Terminal 995", + "type": "TERMINAL", + "updated_at": "2023-09-29T12:39:56.335742073Z", + "version": "5.41.0085" + }, + "components": [ + { + "application_details": { + "application_type": "TERMINAL_API", + "session_location": "LMN2K7S3RTOU3", + "version": "6.25" + }, + "type": "APPLICATION", + "card_reader_details": { + "version": "version0" + }, + "battery_details": { + "visible_percent": 108, + "external_power": "AVAILABLE_CHARGING" + }, + "wifi_details": { + "active": false, + "ssid": "ssid8", + "ip_address_v4": "ip_address_v42", + "secure_connection": "secure_connection8", + "signal_strength": { + "value": 222 + } + }, + "ethernet_details": { + "active": false, + "ip_address_v4": "ip_address_v42" + } + }, + { + "card_reader_details": { + "version": "3.53.70" + }, + "type": "CARD_READER", + "application_details": { + "application_type": "TERMINAL_API", + "version": "version4", + "session_location": "session_location0", + "device_code_id": "device_code_id2" + }, + "battery_details": { + "visible_percent": 108, + "external_power": "AVAILABLE_CHARGING" + }, + "wifi_details": { + "active": false, + "ssid": "ssid8", + "ip_address_v4": "ip_address_v42", + "secure_connection": "secure_connection8", + "signal_strength": { + "value": 222 + } + }, + "ethernet_details": { + "active": false, + "ip_address_v4": "ip_address_v42" + } + }, + { + "battery_details": { + "external_power": "AVAILABLE_CHARGING", + "visible_percent": 24 + }, + "type": "BATTERY", + "application_details": { + "application_type": "TERMINAL_API", + "version": "version4", + "session_location": "session_location0", + "device_code_id": "device_code_id2" + }, + "card_reader_details": { + "version": "version0" + }, + "wifi_details": { + "active": false, + "ssid": "ssid8", + "ip_address_v4": "ip_address_v42", + "secure_connection": "secure_connection8", + "signal_strength": { + "value": 222 + } + }, + "ethernet_details": { + "active": false, + "ip_address_v4": "ip_address_v42" + } + }, + { + "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" + }, + "application_details": { + "application_type": "TERMINAL_API", + "version": "version4", + "session_location": "session_location0", + "device_code_id": "device_code_id2" + }, + "card_reader_details": { + "version": "version0" + }, + "battery_details": { + "visible_percent": 108, + "external_power": "AVAILABLE_CHARGING" + }, + "ethernet_details": { + "active": false, + "ip_address_v4": "ip_address_v42" + } + }, + { + "ethernet_details": { + "active": false + }, + "type": "ETHERNET", + "application_details": { + "application_type": "TERMINAL_API", + "version": "version4", + "session_location": "session_location0", + "device_code_id": "device_code_id2" + }, + "card_reader_details": { + "version": "version0" + }, + "battery_details": { + "visible_percent": 108, + "external_power": "AVAILABLE_CHARGING" + }, + "wifi_details": { + "active": false, + "ssid": "ssid8", + "ip_address_v4": "ip_address_v42", + "secure_connection": "secure_connection8", + "signal_strength": { + "value": 222 + } + } + } + ], + "id": "device:995CS234B5493559", + "status": { + "category": "NEEDS_ATTENTION" + } + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/list-dispute-evidence-request.md b/legacy/doc/models/list-dispute-evidence-request.md new file mode 100644 index 000000000..41a392185 --- /dev/null +++ b/legacy/doc/models/list-dispute-evidence-request.md @@ -0,0 +1,23 @@ + +# List Dispute Evidence Request + +Defines the parameters for a `ListDisputeEvidence` request. + +## Structure + +`ListDisputeEvidenceRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `cursor` | `string \| null \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "cursor": "cursor6" +} +``` + diff --git a/legacy/doc/models/list-dispute-evidence-response.md b/legacy/doc/models/list-dispute-evidence-response.md new file mode 100644 index 000000000..43d20f5e8 --- /dev/null +++ b/legacy/doc/models/list-dispute-evidence-response.md @@ -0,0 +1,45 @@ + +# List Dispute Evidence Response + +Defines the fields in a `ListDisputeEvidence` response. + +## Structure + +`ListDisputeEvidenceResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `evidence` | [`DisputeEvidence[] \| undefined`](../../doc/models/dispute-evidence.md) | Optional | The list of evidence previously uploaded to the specified dispute. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | +| `cursor` | `string \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "evidence": [ + { + "evidence_id": "evidence_id0", + "id": "id2", + "dispute_id": "dispute_id4", + "evidence_file": { + "filename": "filename8", + "filetype": "filetype8" + }, + "evidence_text": "evidence_text6" + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "cursor": "cursor6" +} +``` + diff --git a/legacy/doc/models/list-disputes-request.md b/legacy/doc/models/list-disputes-request.md new file mode 100644 index 000000000..e0918112a --- /dev/null +++ b/legacy/doc/models/list-disputes-request.md @@ -0,0 +1,31 @@ + +# List Disputes Request + +Defines the request parameters for the `ListDisputes` endpoint. + +## Structure + +`ListDisputesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `cursor` | `string \| null \| undefined` | Optional | 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` | [`string[] \| null \| undefined`](../../doc/models/dispute-state.md) | Optional | The dispute states used to filter the result. If not specified, the endpoint returns all disputes.
See [DisputeState](#type-disputestate) for possible values | +| `locationId` | `string \| null \| undefined` | Optional | The ID of the location for which to return a list of disputes.
If not specified, the endpoint returns disputes associated with all locations.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | + +## Example (as JSON) + +```json +{ + "cursor": "cursor2", + "states": [ + "INQUIRY_EVIDENCE_REQUIRED", + "INQUIRY_PROCESSING", + "INQUIRY_CLOSED" + ], + "location_id": "location_id8" +} +``` + diff --git a/legacy/doc/models/list-disputes-response.md b/legacy/doc/models/list-disputes-response.md new file mode 100644 index 000000000..c153ee3a2 --- /dev/null +++ b/legacy/doc/models/list-disputes-response.md @@ -0,0 +1,77 @@ + +# List Disputes Response + +Defines fields in a `ListDisputes` response. + +## Structure + +`ListDisputesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | +| `disputes` | [`Dispute[] \| undefined`](../../doc/models/dispute.md) | Optional | The list of disputes. | +| `cursor` | `string \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "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, + "dispute_id": "dispute_id4" + }, + { + "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, + "dispute_id": "dispute_id4" + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/list-employee-wages-request.md b/legacy/doc/models/list-employee-wages-request.md new file mode 100644 index 000000000..ca7642f3c --- /dev/null +++ b/legacy/doc/models/list-employee-wages-request.md @@ -0,0 +1,27 @@ + +# List Employee Wages Request + +A request for a set of `EmployeeWage` objects. + +## Structure + +`ListEmployeeWagesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `employeeId` | `string \| null \| undefined` | Optional | Filter the returned wages to only those that are associated with the specified employee. | +| `limit` | `number \| null \| undefined` | Optional | The maximum number of `EmployeeWage` results to return per page. The number can range between
1 and 200. The default is 200.
**Constraints**: `>= 1`, `<= 200` | +| `cursor` | `string \| null \| undefined` | Optional | A pointer to the next page of `EmployeeWage` results to fetch. | + +## Example (as JSON) + +```json +{ + "employee_id": "employee_id2", + "limit": 58, + "cursor": "cursor4" +} +``` + diff --git a/legacy/doc/models/list-employee-wages-response.md b/legacy/doc/models/list-employee-wages-response.md new file mode 100644 index 000000000..4a9cf474c --- /dev/null +++ b/legacy/doc/models/list-employee-wages-response.md @@ -0,0 +1,72 @@ + +# List Employee Wages Response + +The response to a request for a set of `EmployeeWage` objects. The response contains +a set of `EmployeeWage` objects. + +## Structure + +`ListEmployeeWagesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `employeeWages` | [`EmployeeWage[] \| undefined`](../../doc/models/employee-wage.md) | Optional | A page of `EmployeeWage` results. | +| `cursor` | `string \| undefined` | Optional | The value supplied in the subsequent request to fetch the next page
of `EmployeeWage` results. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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" + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/list-employees-request.md b/legacy/doc/models/list-employees-request.md new file mode 100644 index 000000000..6439901ef --- /dev/null +++ b/legacy/doc/models/list-employees-request.md @@ -0,0 +1,27 @@ + +# List Employees Request + +## Structure + +`ListEmployeesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string \| null \| undefined` | Optional | - | +| `status` | [`string \| undefined`](../../doc/models/employee-status.md) | Optional | The status of the Employee being retrieved.

DEPRECATED at version 2020-08-26. Replaced by [TeamMemberStatus](entity:TeamMemberStatus). | +| `limit` | `number \| null \| undefined` | Optional | The number of employees to be returned on each page. | +| `cursor` | `string \| null \| undefined` | Optional | The token required to retrieve the specified page of results. | + +## Example (as JSON) + +```json +{ + "location_id": "location_id4", + "status": "ACTIVE", + "limit": 18, + "cursor": "cursor6" +} +``` + diff --git a/legacy/doc/models/list-employees-response.md b/legacy/doc/models/list-employees-response.md new file mode 100644 index 000000000..4df6d431f --- /dev/null +++ b/legacy/doc/models/list-employees-response.md @@ -0,0 +1,52 @@ + +# List Employees Response + +## Structure + +`ListEmployeesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `employees` | [`Employee[] \| undefined`](../../doc/models/employee.md) | Optional | - | +| `cursor` | `string \| undefined` | Optional | The token to be used to retrieve the next page of results. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "employees": [ + { + "id": "id4", + "first_name": "first_name4", + "last_name": "last_name2", + "email": "email2", + "phone_number": "phone_number8" + } + ], + "cursor": "cursor8", + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/list-event-types-request.md b/legacy/doc/models/list-event-types-request.md new file mode 100644 index 000000000..435dd32a4 --- /dev/null +++ b/legacy/doc/models/list-event-types-request.md @@ -0,0 +1,23 @@ + +# List Event Types Request + +Lists all event types that can be subscribed to. + +## Structure + +`ListEventTypesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `apiVersion` | `string \| null \| undefined` | Optional | The API version for which to list event types. Setting this field overrides the default version used by the application. | + +## Example (as JSON) + +```json +{ + "api_version": "api_version0" +} +``` + diff --git a/legacy/doc/models/list-event-types-response.md b/legacy/doc/models/list-event-types-response.md new file mode 100644 index 000000000..7ab035e51 --- /dev/null +++ b/legacy/doc/models/list-event-types-response.md @@ -0,0 +1,52 @@ + +# List Event Types Response + +Defines the fields that are included in the response body of +a request to the [ListEventTypes](../../doc/api/events.md#list-event-types) endpoint. + +Note: if there are errors processing the request, the event types field will not be +present. + +## Structure + +`ListEventTypesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | +| `eventTypes` | `string[] \| undefined` | Optional | The list of event types. | +| `metadata` | [`EventTypeMetadata[] \| undefined`](../../doc/models/event-type-metadata.md) | Optional | Contains the metadata of an event type. For more information, see [EventTypeMetadata](entity:EventTypeMetadata). | + +## Example (as JSON) + +```json +{ + "event_types": [ + "inventory.count.updated" + ], + "metadata": [ + { + "api_version_introduced": "2018-07-12", + "event_type": "inventory.count.updated", + "release_status": "PUBLIC" + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/list-gift-card-activities-request.md b/legacy/doc/models/list-gift-card-activities-request.md new file mode 100644 index 000000000..f9d24ab7e --- /dev/null +++ b/legacy/doc/models/list-gift-card-activities-request.md @@ -0,0 +1,35 @@ + +# List Gift Card Activities Request + +Returns a list of gift card activities. You can optionally specify a filter to retrieve a +subset of activites. + +## Structure + +`ListGiftCardActivitiesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `giftCardId` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `50` | +| `type` | `string \| null \| undefined` | Optional | 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. | +| `locationId` | `string \| null \| undefined` | Optional | 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. | +| `beginTime` | `string \| null \| undefined` | Optional | 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. | +| `endTime` | `string \| null \| undefined` | Optional | 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` | `number \| null \| undefined` | Optional | 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).
**Constraints**: `>= 1`, `<= 100` | +| `cursor` | `string \| null \| undefined` | Optional | 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). | +| `sortOrder` | `string \| null \| undefined` | Optional | The order in which the endpoint returns the activities, based on `created_at`.

- `ASC` - Oldest to newest.
- `DESC` - Newest to oldest (default). | + +## Example (as JSON) + +```json +{ + "gift_card_id": "gift_card_id6", + "type": "type8", + "location_id": "location_id2", + "begin_time": "begin_time6", + "end_time": "end_time0" +} +``` + diff --git a/legacy/doc/models/list-gift-card-activities-response.md b/legacy/doc/models/list-gift-card-activities-response.md new file mode 100644 index 000000000..a93240812 --- /dev/null +++ b/legacy/doc/models/list-gift-card-activities-response.md @@ -0,0 +1,76 @@ + +# List Gift Card Activities Response + +A response that contains a list of `GiftCardActivity` objects. If the request resulted in errors, +the response contains a set of `Error` objects. + +## Structure + +`ListGiftCardActivitiesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `giftCardActivities` | [`GiftCardActivity[] \| undefined`](../../doc/models/gift-card-activity.md) | Optional | The requested gift card activities or an empty object if none are found. | +| `cursor` | `string \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "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" + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "cursor": "cursor2" +} +``` + diff --git a/legacy/doc/models/list-gift-cards-request.md b/legacy/doc/models/list-gift-cards-request.md new file mode 100644 index 000000000..9537e409f --- /dev/null +++ b/legacy/doc/models/list-gift-cards-request.md @@ -0,0 +1,32 @@ + +# List Gift Cards Request + +A request to list gift cards. You can optionally specify a filter to retrieve a subset of +gift cards. + +## Structure + +`ListGiftCardsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `type` | `string \| null \| undefined` | Optional | 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` | `string \| null \| undefined` | Optional | 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` | `number \| null \| undefined` | Optional | 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).
**Constraints**: `>= 1`, `<= 200` | +| `cursor` | `string \| null \| undefined` | Optional | 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). | +| `customerId` | `string \| null \| undefined` | Optional | If a customer ID is provided, the endpoint returns only the gift cards linked to the specified customer.
**Constraints**: *Maximum Length*: `191` | + +## Example (as JSON) + +```json +{ + "type": "type0", + "state": "state6", + "limit": 162, + "cursor": "cursor4", + "customer_id": "customer_id8" +} +``` + diff --git a/legacy/doc/models/list-gift-cards-response.md b/legacy/doc/models/list-gift-cards-response.md new file mode 100644 index 000000000..0f935aa7a --- /dev/null +++ b/legacy/doc/models/list-gift-cards-response.md @@ -0,0 +1,72 @@ + +# List Gift Cards Response + +A response that contains a list of `GiftCard` objects. If the request resulted in errors, +the response contains a set of `Error` objects. + +## Structure + +`ListGiftCardsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `giftCards` | [`GiftCard[] \| undefined`](../../doc/models/gift-card.md) | Optional | The requested gift cards or an empty object if none are found. | +| `cursor` | `string \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "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" + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/list-invoices-request.md b/legacy/doc/models/list-invoices-request.md new file mode 100644 index 000000000..d1578eeb0 --- /dev/null +++ b/legacy/doc/models/list-invoices-request.md @@ -0,0 +1,27 @@ + +# List Invoices Request + +Describes a `ListInvoice` request. + +## Structure + +`ListInvoicesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string` | Required | The ID of the location for which to list invoices.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | +| `cursor` | `string \| null \| undefined` | Optional | 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` | `number \| null \| undefined` | Optional | The maximum number of invoices to return (200 is the maximum `limit`).
If not provided, the server uses a default limit of 100 invoices. | + +## Example (as JSON) + +```json +{ + "location_id": "location_id2", + "cursor": "cursor8", + "limit": 152 +} +``` + diff --git a/legacy/doc/models/list-invoices-response.md b/legacy/doc/models/list-invoices-response.md new file mode 100644 index 000000000..42b1e965c --- /dev/null +++ b/legacy/doc/models/list-invoices-response.md @@ -0,0 +1,196 @@ + +# List Invoices Response + +Describes a `ListInvoice` response. + +## Structure + +`ListInvoicesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `invoices` | [`Invoice[] \| undefined`](../../doc/models/invoice.md) | Optional | The invoices retrieved. | +| `cursor` | `string \| undefined` | Optional | 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` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | + +## Example (as JSON) + +```json +{ + "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", + "address": { + "address_line_1": "address_line_16", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "locality": "locality6", + "sublocality": "sublocality6" + } + }, + "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", + "address": { + "address_line_1": "address_line_16", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "locality": "locality6", + "sublocality": "sublocality6" + } + }, + "public_url": "https://squareup.com/pay-invoice/h9sfsfTGTSnYEhISUDBhEQ", + "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 + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/list-jobs-request.md b/legacy/doc/models/list-jobs-request.md new file mode 100644 index 000000000..a273a7fb0 --- /dev/null +++ b/legacy/doc/models/list-jobs-request.md @@ -0,0 +1,23 @@ + +# List Jobs Request + +Represents a [ListJobs](../../doc/api/team.md#list-jobs) request. + +## Structure + +`ListJobsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `cursor` | `string \| null \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "cursor": "cursor4" +} +``` + diff --git a/legacy/doc/models/list-jobs-response.md b/legacy/doc/models/list-jobs-response.md new file mode 100644 index 000000000..528544f02 --- /dev/null +++ b/legacy/doc/models/list-jobs-response.md @@ -0,0 +1,52 @@ + +# List Jobs Response + +Represents a [ListJobs](../../doc/api/team.md#list-jobs) response. Either `jobs` or `errors` +is present in the response. If additional results are available, the `cursor` field is also present. + +## Structure + +`ListJobsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `jobs` | [`Job[] \| undefined`](../../doc/models/job.md) | Optional | The retrieved jobs. A single paged response contains up to 100 jobs. | +| `cursor` | `string \| undefined` | Optional | 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` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | The errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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 + } + ], + "cursor": "cursor6", + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/list-location-booking-profiles-request.md b/legacy/doc/models/list-location-booking-profiles-request.md new file mode 100644 index 000000000..bd95105b8 --- /dev/null +++ b/legacy/doc/models/list-location-booking-profiles-request.md @@ -0,0 +1,23 @@ + +# List Location Booking Profiles Request + +## Structure + +`ListLocationBookingProfilesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `limit` | `number \| null \| undefined` | Optional | The maximum number of results to return in a paged response.
**Constraints**: `>= 1`, `<= 100` | +| `cursor` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `65536` | + +## Example (as JSON) + +```json +{ + "limit": 134, + "cursor": "cursor2" +} +``` + diff --git a/legacy/doc/models/list-location-booking-profiles-response.md b/legacy/doc/models/list-location-booking-profiles-response.md new file mode 100644 index 000000000..cba044844 --- /dev/null +++ b/legacy/doc/models/list-location-booking-profiles-response.md @@ -0,0 +1,36 @@ + +# List Location Booking Profiles Response + +## Structure + +`ListLocationBookingProfilesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationBookingProfiles` | [`LocationBookingProfile[] \| undefined`](../../doc/models/location-booking-profile.md) | Optional | The list of a seller's location booking profiles. | +| `cursor` | `string \| undefined` | Optional | 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` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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, + "booking_site_url": "booking_site_url2" + } + ], + "cursor": "cursor8" +} +``` + diff --git a/legacy/doc/models/list-location-custom-attribute-definitions-request.md b/legacy/doc/models/list-location-custom-attribute-definitions-request.md new file mode 100644 index 000000000..cb6e2f9f6 --- /dev/null +++ b/legacy/doc/models/list-location-custom-attribute-definitions-request.md @@ -0,0 +1,27 @@ + +# List Location Custom Attribute Definitions Request + +Represents a [ListLocationCustomAttributeDefinitions](../../doc/api/location-custom-attributes.md#list-location-custom-attribute-definitions) request. + +## Structure + +`ListLocationCustomAttributeDefinitionsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `visibilityFilter` | [`string \| undefined`](../../doc/models/visibility-filter.md) | Optional | Enumeration of visibility-filter values used to set the ability to view custom attributes or custom attribute definitions. | +| `limit` | `number \| null \| undefined` | Optional | 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).
**Constraints**: `>= 1`, `<= 100` | +| `cursor` | `string \| null \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "visibility_filter": "ALL", + "limit": 242, + "cursor": "cursor8" +} +``` + diff --git a/legacy/doc/models/list-location-custom-attribute-definitions-response.md b/legacy/doc/models/list-location-custom-attribute-definitions-response.md new file mode 100644 index 000000000..951d9394c --- /dev/null +++ b/legacy/doc/models/list-location-custom-attribute-definitions-response.md @@ -0,0 +1,63 @@ + +# List Location Custom Attribute Definitions Response + +Represents a [ListLocationCustomAttributeDefinitions](../../doc/api/location-custom-attributes.md#list-location-custom-attribute-definitions) 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`. + +## Structure + +`ListLocationCustomAttributeDefinitionsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttributeDefinitions` | [`CustomAttributeDefinition[] \| undefined`](../../doc/models/custom-attribute-definition.md) | Optional | The retrieved custom attribute definitions. If no custom attribute definitions are found,
Square returns an empty object (`{}`). | +| `cursor` | `string \| undefined` | Optional | 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` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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": { + "key1": "val1", + "key2": "val2" + }, + "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": { + "key1": "val1", + "key2": "val2" + }, + "updated_at": "2022-12-03T10:17:52.341Z", + "version": 4, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/list-location-custom-attributes-request.md b/legacy/doc/models/list-location-custom-attributes-request.md new file mode 100644 index 000000000..b4800219d --- /dev/null +++ b/legacy/doc/models/list-location-custom-attributes-request.md @@ -0,0 +1,29 @@ + +# List Location Custom Attributes Request + +Represents a [ListLocationCustomAttributes](../../doc/api/location-custom-attributes.md#list-location-custom-attributes) request. + +## Structure + +`ListLocationCustomAttributesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `visibilityFilter` | [`string \| undefined`](../../doc/models/visibility-filter.md) | Optional | Enumeration of visibility-filter values used to set the ability to view custom attributes or custom attribute definitions. | +| `limit` | `number \| null \| undefined` | Optional | 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).
**Constraints**: `>= 1`, `<= 100` | +| `cursor` | `string \| null \| undefined` | Optional | 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). | +| `withDefinitions` | `boolean \| null \| undefined` | Optional | 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`. | + +## Example (as JSON) + +```json +{ + "visibility_filter": "ALL", + "limit": 172, + "cursor": "cursor6", + "with_definitions": false +} +``` + diff --git a/legacy/doc/models/list-location-custom-attributes-response.md b/legacy/doc/models/list-location-custom-attributes-response.md new file mode 100644 index 000000000..0736780e8 --- /dev/null +++ b/legacy/doc/models/list-location-custom-attributes-response.md @@ -0,0 +1,81 @@ + +# List Location Custom Attributes Response + +Represents a [ListLocationCustomAttributes](../../doc/api/location-custom-attributes.md#list-location-custom-attributes) 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`. + +## Structure + +`ListLocationCustomAttributesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttributes` | [`CustomAttribute[] \| undefined`](../../doc/models/custom-attribute.md) | Optional | 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` | `string \| undefined` | Optional | 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` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "custom_attributes": [ + { + "key": "key8", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 180, + "visibility": "VISIBILITY_HIDDEN", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + { + "key": "key8", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 180, + "visibility": "VISIBILITY_HIDDEN", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + } + ], + "cursor": "cursor0", + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/list-locations-response.md b/legacy/doc/models/list-locations-response.md new file mode 100644 index 000000000..b34ef3b7e --- /dev/null +++ b/legacy/doc/models/list-locations-response.md @@ -0,0 +1,99 @@ + +# List Locations Response + +Defines the fields that are included in the response body of a request +to the [ListLocations](../../doc/api/locations.md#list-locations) endpoint. + +Either `errors` or `locations` is present in a given response (never both). + +## Structure + +`ListLocationsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `locations` | [`Location[] \| undefined`](../../doc/models/location.md) | Optional | The business locations. | + +## Example (as JSON) + +```json +{ + "locations": [ + { + "address": { + "address_line_1": "123 Main St", + "administrative_district_level_1": "CA", + "country": "US", + "locality": "San Francisco", + "postal_code": "94114", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "sublocality": "sublocality6" + }, + "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", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "sublocality": "sublocality6" + }, + "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" + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/list-loyalty-programs-response.md b/legacy/doc/models/list-loyalty-programs-response.md new file mode 100644 index 000000000..fd658f2c2 --- /dev/null +++ b/legacy/doc/models/list-loyalty-programs-response.md @@ -0,0 +1,110 @@ + +# List Loyalty Programs Response + +A response that contains all loyalty programs. + +## Structure + +`ListLoyaltyProgramsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `programs` | [`LoyaltyProgram[] \| undefined`](../../doc/models/loyalty-program.md) | Optional | A list of `LoyaltyProgram` for the merchant. | + +## Example (as JSON) + +```json +{ + "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", + "definition": { + "discount_type": "FIXED_PERCENTAGE", + "percentage_discount": "10", + "scope": "ORDER", + "catalog_object_ids": [ + "catalog_object_ids6" + ], + "fixed_discount_money": { + "amount": 36, + "currency": "SLL" + }, + "max_discount_money": { + "amount": 84, + "currency": "BOB" + } + }, + "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", + "expiration_policy": { + "expiration_duration": "expiration_duration0" + } + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/list-loyalty-promotions-request.md b/legacy/doc/models/list-loyalty-promotions-request.md new file mode 100644 index 000000000..bdaa37bfd --- /dev/null +++ b/legacy/doc/models/list-loyalty-promotions-request.md @@ -0,0 +1,27 @@ + +# List Loyalty Promotions Request + +Represents a [ListLoyaltyPromotions](../../doc/api/loyalty.md#list-loyalty-promotions) request. + +## Structure + +`ListLoyaltyPromotionsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `status` | [`string \| undefined`](../../doc/models/loyalty-promotion-status.md) | Optional | Indicates the status of a [loyalty promotion](../../doc/models/loyalty-promotion.md). | +| `cursor` | `string \| null \| undefined` | Optional | 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` | `number \| null \| undefined` | Optional | 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).
**Constraints**: `>= 1`, `<= 30` | + +## Example (as JSON) + +```json +{ + "status": "CANCELED", + "cursor": "cursor2", + "limit": 58 +} +``` + diff --git a/legacy/doc/models/list-loyalty-promotions-response.md b/legacy/doc/models/list-loyalty-promotions-response.md new file mode 100644 index 000000000..429b197ae --- /dev/null +++ b/legacy/doc/models/list-loyalty-promotions-response.md @@ -0,0 +1,124 @@ + +# List Loyalty Promotions Response + +Represents a [ListLoyaltyPromotions](../../doc/api/loyalty.md#list-loyalty-promotions) 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`. + +## Structure + +`ListLoyaltyPromotionsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `loyaltyPromotions` | [`LoyaltyPromotion[] \| undefined`](../../doc/models/loyalty-promotion.md) | Optional | The retrieved loyalty promotions. | +| `cursor` | `string \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "loyalty_promotions": [ + { + "available_time": { + "start_date": "2022-08-16", + "time_periods": [ + "BEGIN:VEVENT\nDTSTART:20220816T160000\nDURATION:PT2H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT" + ], + "end_date": "end_date8" + }, + "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", + "points_addition_data": { + "points_addition": 218 + } + }, + "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", + "canceled_at": "canceled_at0" + }, + { + "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", + "points_addition_data": { + "points_addition": 218 + } + }, + "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", + "canceled_at": "canceled_at0" + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "cursor": "cursor8" +} +``` + diff --git a/legacy/doc/models/list-merchant-custom-attribute-definitions-request.md b/legacy/doc/models/list-merchant-custom-attribute-definitions-request.md new file mode 100644 index 000000000..5e694fcd6 --- /dev/null +++ b/legacy/doc/models/list-merchant-custom-attribute-definitions-request.md @@ -0,0 +1,27 @@ + +# List Merchant Custom Attribute Definitions Request + +Represents a [ListMerchantCustomAttributeDefinitions](../../doc/api/merchant-custom-attributes.md#list-merchant-custom-attribute-definitions) request. + +## Structure + +`ListMerchantCustomAttributeDefinitionsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `visibilityFilter` | [`string \| undefined`](../../doc/models/visibility-filter.md) | Optional | Enumeration of visibility-filter values used to set the ability to view custom attributes or custom attribute definitions. | +| `limit` | `number \| null \| undefined` | Optional | 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).
**Constraints**: `>= 1`, `<= 100` | +| `cursor` | `string \| null \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "visibility_filter": "ALL", + "limit": 48, + "cursor": "cursor6" +} +``` + diff --git a/legacy/doc/models/list-merchant-custom-attribute-definitions-response.md b/legacy/doc/models/list-merchant-custom-attribute-definitions-response.md new file mode 100644 index 000000000..5e1687800 --- /dev/null +++ b/legacy/doc/models/list-merchant-custom-attribute-definitions-response.md @@ -0,0 +1,69 @@ + +# List Merchant Custom Attribute Definitions Response + +Represents a [ListMerchantCustomAttributeDefinitions](../../doc/api/merchant-custom-attributes.md#list-merchant-custom-attribute-definitions) 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`. + +## Structure + +`ListMerchantCustomAttributeDefinitionsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttributeDefinitions` | [`CustomAttributeDefinition[] \| undefined`](../../doc/models/custom-attribute-definition.md) | Optional | The retrieved custom attribute definitions. If no custom attribute definitions are found,
Square returns an empty object (`{}`). | +| `cursor` | `string \| undefined` | Optional | 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` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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": { + "key1": "val1", + "key2": "val2" + }, + "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": { + "key1": "val1", + "key2": "val2" + }, + "updated_at": "2023-05-05T10:17:52.341Z", + "version": 4, + "visibility": "VISIBILITY_READ_ONLY" + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/list-merchant-custom-attributes-request.md b/legacy/doc/models/list-merchant-custom-attributes-request.md new file mode 100644 index 000000000..f7f0580a4 --- /dev/null +++ b/legacy/doc/models/list-merchant-custom-attributes-request.md @@ -0,0 +1,29 @@ + +# List Merchant Custom Attributes Request + +Represents a [ListMerchantCustomAttributes](../../doc/api/merchant-custom-attributes.md#list-merchant-custom-attributes) request. + +## Structure + +`ListMerchantCustomAttributesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `visibilityFilter` | [`string \| undefined`](../../doc/models/visibility-filter.md) | Optional | Enumeration of visibility-filter values used to set the ability to view custom attributes or custom attribute definitions. | +| `limit` | `number \| null \| undefined` | Optional | 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).
**Constraints**: `>= 1`, `<= 100` | +| `cursor` | `string \| null \| undefined` | Optional | 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). | +| `withDefinitions` | `boolean \| null \| undefined` | Optional | 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`. | + +## Example (as JSON) + +```json +{ + "visibility_filter": "READ_WRITE", + "limit": 132, + "cursor": "cursor6", + "with_definitions": false +} +``` + diff --git a/legacy/doc/models/list-merchant-custom-attributes-response.md b/legacy/doc/models/list-merchant-custom-attributes-response.md new file mode 100644 index 000000000..b4c31bfc7 --- /dev/null +++ b/legacy/doc/models/list-merchant-custom-attributes-response.md @@ -0,0 +1,56 @@ + +# List Merchant Custom Attributes Response + +Represents a [ListMerchantCustomAttributes](../../doc/api/merchant-custom-attributes.md#list-merchant-custom-attributes) 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`. + +## Structure + +`ListMerchantCustomAttributesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttributes` | [`CustomAttribute[] \| undefined`](../../doc/models/custom-attribute.md) | Optional | 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` | `string \| undefined` | Optional | 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` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "custom_attributes": [ + { + "key": "key8", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 180, + "visibility": "VISIBILITY_HIDDEN", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + } + ], + "cursor": "cursor6", + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/list-merchants-request.md b/legacy/doc/models/list-merchants-request.md new file mode 100644 index 000000000..ef2ea6df7 --- /dev/null +++ b/legacy/doc/models/list-merchants-request.md @@ -0,0 +1,23 @@ + +# List Merchants Request + +Request object for the [ListMerchant](../../doc/api/merchants.md#list-merchants) endpoint. + +## Structure + +`ListMerchantsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `cursor` | `number \| null \| undefined` | Optional | The cursor generated by the previous response. | + +## Example (as JSON) + +```json +{ + "cursor": 106 +} +``` + diff --git a/legacy/doc/models/list-merchants-response.md b/legacy/doc/models/list-merchants-response.md new file mode 100644 index 000000000..9c4331948 --- /dev/null +++ b/legacy/doc/models/list-merchants-response.md @@ -0,0 +1,45 @@ + +# List Merchants Response + +The response object returned by the [ListMerchant](../../doc/api/merchants.md#list-merchants) endpoint. + +## Structure + +`ListMerchantsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | +| `merchant` | [`Merchant[] \| undefined`](../../doc/models/merchant.md) | Optional | The requested `Merchant` entities. | +| `cursor` | `number \| undefined` | Optional | If the response is truncated, the cursor to use in next request to fetch next set of objects. | + +## Example (as JSON) + +```json +{ + "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" + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "cursor": 124 +} +``` + diff --git a/legacy/doc/models/list-order-custom-attribute-definitions-request.md b/legacy/doc/models/list-order-custom-attribute-definitions-request.md new file mode 100644 index 000000000..c4bdfa1b9 --- /dev/null +++ b/legacy/doc/models/list-order-custom-attribute-definitions-request.md @@ -0,0 +1,27 @@ + +# List Order Custom Attribute Definitions Request + +Represents a list request for order custom attribute definitions. + +## Structure + +`ListOrderCustomAttributeDefinitionsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `visibilityFilter` | [`string \| undefined`](../../doc/models/visibility-filter.md) | Optional | Enumeration of visibility-filter values used to set the ability to view custom attributes or custom attribute definitions. | +| `cursor` | `string \| null \| undefined` | Optional | 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).
**Constraints**: *Minimum Length*: `1` | +| `limit` | `number \| null \| undefined` | Optional | 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).
**Constraints**: `>= 1`, `<= 100` | + +## Example (as JSON) + +```json +{ + "visibility_filter": "READ_WRITE", + "cursor": "cursor2", + "limit": 6 +} +``` + diff --git a/legacy/doc/models/list-order-custom-attribute-definitions-response.md b/legacy/doc/models/list-order-custom-attribute-definitions-response.md new file mode 100644 index 000000000..8656cd386 --- /dev/null +++ b/legacy/doc/models/list-order-custom-attribute-definitions-response.md @@ -0,0 +1,80 @@ + +# List Order Custom Attribute Definitions Response + +Represents a response from listing order custom attribute definitions. + +## Structure + +`ListOrderCustomAttributeDefinitionsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttributeDefinitions` | [`CustomAttributeDefinition[]`](../../doc/models/custom-attribute-definition.md) | Required | The retrieved custom attribute definitions. If no custom attribute definitions are found, Square returns an empty object (`{}`). | +| `cursor` | `string \| undefined` | Optional | 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).
**Constraints**: *Minimum Length*: `1` | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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": { + "key1": "val1", + "key2": "val2" + }, + "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": { + "key1": "val1", + "key2": "val2" + }, + "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": { + "key1": "val1", + "key2": "val2" + }, + "updated_at": "2022-11-16T18:04:21.912Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + } + ], + "cursor": "cursor4", + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/list-order-custom-attributes-request.md b/legacy/doc/models/list-order-custom-attributes-request.md new file mode 100644 index 000000000..307d8ac4e --- /dev/null +++ b/legacy/doc/models/list-order-custom-attributes-request.md @@ -0,0 +1,29 @@ + +# List Order Custom Attributes Request + +Represents a list request for order custom attributes. + +## Structure + +`ListOrderCustomAttributesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `visibilityFilter` | [`string \| undefined`](../../doc/models/visibility-filter.md) | Optional | Enumeration of visibility-filter values used to set the ability to view custom attributes or custom attribute definitions. | +| `cursor` | `string \| null \| undefined` | Optional | 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).
**Constraints**: *Minimum Length*: `1` | +| `limit` | `number \| null \| undefined` | Optional | 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).
**Constraints**: `>= 1`, `<= 100` | +| `withDefinitions` | `boolean \| null \| undefined` | Optional | 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`. | + +## Example (as JSON) + +```json +{ + "visibility_filter": "READ", + "cursor": "cursor2", + "limit": 158, + "with_definitions": false +} +``` + diff --git a/legacy/doc/models/list-order-custom-attributes-response.md b/legacy/doc/models/list-order-custom-attributes-response.md new file mode 100644 index 000000000..c2dc2f018 --- /dev/null +++ b/legacy/doc/models/list-order-custom-attributes-response.md @@ -0,0 +1,79 @@ + +# List Order Custom Attributes Response + +Represents a response from listing order custom attributes. + +## Structure + +`ListOrderCustomAttributesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttributes` | [`CustomAttribute[] \| undefined`](../../doc/models/custom-attribute.md) | Optional | The retrieved custom attributes. If no custom attribute are found, Square returns an empty object (`{}`). | +| `cursor` | `string \| undefined` | Optional | 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).
**Constraints**: *Minimum Length*: `1` | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "custom_attributes": [ + { + "key": "key8", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 180, + "visibility": "VISIBILITY_HIDDEN", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + { + "key": "key8", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 180, + "visibility": "VISIBILITY_HIDDEN", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + } + ], + "cursor": "cursor4", + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/list-payment-links-request.md b/legacy/doc/models/list-payment-links-request.md new file mode 100644 index 000000000..79e5ffbf0 --- /dev/null +++ b/legacy/doc/models/list-payment-links-request.md @@ -0,0 +1,23 @@ + +# List Payment Links Request + +## Structure + +`ListPaymentLinksRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `cursor` | `string \| null \| undefined` | Optional | 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` | `number \| null \| undefined` | Optional | 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` | + +## Example (as JSON) + +```json +{ + "cursor": "cursor6", + "limit": 182 +} +``` + diff --git a/legacy/doc/models/list-payment-links-response.md b/legacy/doc/models/list-payment-links-response.md new file mode 100644 index 000000000..d83506920 --- /dev/null +++ b/legacy/doc/models/list-payment-links-response.md @@ -0,0 +1,102 @@ + +# List Payment Links Response + +## Structure + +`ListPaymentLinksResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Errors that occurred during the request. | +| `paymentLinks` | [`PaymentLink[] \| undefined`](../../doc/models/payment-link.md) | Optional | The list of payment links. | +| `cursor` | `string \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "cursor": "MTY1NQ==", + "payment_links": [ + { + "checkout_options": { + "ask_for_shipping_address": true, + "allow_tipping": false, + "custom_fields": [ + { + "title": "title8" + }, + { + "title": "title8" + } + ], + "subscription_plan_id": "subscription_plan_id8", + "redirect_url": "redirect_url2", + "merchant_support_email": "merchant_support_email8" + }, + "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, + "description": "description2", + "pre_populated_data": { + "buyer_email": "buyer_email8", + "buyer_phone_number": "buyer_phone_number0", + "buyer_address": { + "address_line_1": "address_line_12", + "address_line_2": "address_line_22", + "address_line_3": "address_line_38", + "locality": "locality2", + "sublocality": "sublocality2" + } + } + }, + { + "created_at": "2022-04-11T23:14:59Z", + "description": "", + "id": "RY5UNCUMPJN5XKCT", + "order_id": "EmBmGt3zJD15QeO1dxzBTxMxtwfZY", + "url": "https://square.link/u/EXAMPLE", + "version": 1, + "checkout_options": { + "allow_tipping": false, + "custom_fields": [ + { + "title": "title8" + }, + { + "title": "title8" + } + ], + "subscription_plan_id": "subscription_plan_id8", + "redirect_url": "redirect_url2", + "merchant_support_email": "merchant_support_email8" + }, + "pre_populated_data": { + "buyer_email": "buyer_email8", + "buyer_phone_number": "buyer_phone_number0", + "buyer_address": { + "address_line_1": "address_line_12", + "address_line_2": "address_line_22", + "address_line_3": "address_line_38", + "locality": "locality2", + "sublocality": "sublocality2" + } + } + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/list-payment-refunds-request.md b/legacy/doc/models/list-payment-refunds-request.md new file mode 100644 index 000000000..975ffce11 --- /dev/null +++ b/legacy/doc/models/list-payment-refunds-request.md @@ -0,0 +1,37 @@ + +# List Payment Refunds Request + +Describes a request to list refunds using +[ListPaymentRefunds](../../doc/api/refunds.md#list-payment-refunds). + +The maximum results per page is 100. + +## Structure + +`ListPaymentRefundsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `beginTime` | `string \| null \| undefined` | Optional | 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. | +| `endTime` | `string \| null \| undefined` | Optional | 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. | +| `sortOrder` | `string \| null \| undefined` | Optional | The order in which results are listed by `PaymentRefund.created_at`:

- `ASC` - Oldest to newest.
- `DESC` - Newest to oldest (default). | +| `cursor` | `string \| null \| undefined` | Optional | 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). | +| `locationId` | `string \| null \| undefined` | Optional | Limit results to the location supplied. By default, results are returned
for all locations associated with the seller. | +| `status` | `string \| null \| undefined` | Optional | 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. | +| `sourceType` | `string \| null \| undefined` | Optional | 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` | `number \| null \| undefined` | Optional | 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 | + +## Example (as JSON) + +```json +{ + "begin_time": "begin_time8", + "end_time": "end_time2", + "sort_order": "sort_order0", + "cursor": "cursor4", + "location_id": "location_id4" +} +``` + diff --git a/legacy/doc/models/list-payment-refunds-response.md b/legacy/doc/models/list-payment-refunds-response.md new file mode 100644 index 000000000..bb1ba1eab --- /dev/null +++ b/legacy/doc/models/list-payment-refunds-response.md @@ -0,0 +1,97 @@ + +# List Payment Refunds Response + +Defines the response returned by [ListPaymentRefunds](../../doc/api/refunds.md#list-payment-refunds). + +Either `errors` or `refunds` is present in a given response (never both). + +## Structure + +`ListPaymentRefundsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | +| `refunds` | [`PaymentRefund[] \| undefined`](../../doc/models/payment-refund.md) | Optional | The list of requested refunds. | +| `cursor` | `string \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "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", + "unlinked": false, + "destination_type": "destination_type2", + "destination_details": { + "card_details": { + "card": { + "id": "id6", + "card_brand": "OTHER_BRAND", + "last_4": "last_48", + "exp_month": 228, + "exp_year": 68 + }, + "entry_method": "entry_method8", + "auth_result_code": "auth_result_code0" + }, + "cash_details": { + "seller_supplied_money": { + "amount": 36, + "currency": "MKD" + }, + "change_back_money": { + "amount": 78, + "currency": "XBD" + } + }, + "external_details": { + "type": "type6", + "source": "source0", + "source_id": "source_id8" + } + } + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/list-payments-request.md b/legacy/doc/models/list-payments-request.md new file mode 100644 index 000000000..720a3d399 --- /dev/null +++ b/legacy/doc/models/list-payments-request.md @@ -0,0 +1,44 @@ + +# List Payments Request + +Describes a request to list payments using +[ListPayments](../../doc/api/payments.md#list-payments). + +The maximum results per page is 100. + +## Structure + +`ListPaymentsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `beginTime` | `string \| null \| undefined` | Optional | 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. | +| `endTime` | `string \| null \| undefined` | Optional | 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. | +| `sortOrder` | `string \| null \| undefined` | Optional | The order in which results are listed by `ListPaymentsRequest.sort_field`:

- `ASC` - Oldest to newest.
- `DESC` - Newest to oldest (default). | +| `cursor` | `string \| null \| undefined` | Optional | 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). | +| `locationId` | `string \| null \| undefined` | Optional | Limit results to the location supplied. By default, results are returned
for the default (main) location associated with the seller. | +| `total` | `bigint \| null \| undefined` | Optional | The exact amount in the `total_money` for a payment. | +| `last4` | `string \| null \| undefined` | Optional | The last four digits of a payment card. | +| `cardBrand` | `string \| null \| undefined` | Optional | The brand of the payment card (for example, VISA). | +| `limit` | `number \| null \| undefined` | Optional | 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` | +| `isOfflinePayment` | `boolean \| null \| undefined` | Optional | Whether the payment was taken offline or not. | +| `offlineBeginTime` | `string \| null \| undefined` | Optional | 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. | +| `offlineEndTime` | `string \| null \| undefined` | Optional | 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. | +| `updatedAtBeginTime` | `string \| null \| undefined` | Optional | 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. | +| `updatedAtEndTime` | `string \| null \| undefined` | Optional | 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. | +| `sortField` | [`string \| undefined`](../../doc/models/payment-sort-field.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "begin_time": "begin_time0", + "end_time": "end_time4", + "sort_order": "sort_order2", + "cursor": "cursor4", + "location_id": "location_id6" +} +``` + diff --git a/legacy/doc/models/list-payments-response.md b/legacy/doc/models/list-payments-response.md new file mode 100644 index 000000000..f2097cb55 --- /dev/null +++ b/legacy/doc/models/list-payments-response.md @@ -0,0 +1,105 @@ + +# List Payments Response + +Defines the response returned by [ListPayments](../../doc/api/payments.md#list-payments). + +## Structure + +`ListPaymentsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | +| `payments` | [`Payment[] \| undefined`](../../doc/models/payment.md) | Optional | The requested list of payments. | +| `cursor` | `string \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "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", + "tip_money": { + "amount": 190, + "currency": "TWD" + } + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "cursor": "cursor0" +} +``` + diff --git a/legacy/doc/models/list-payout-entries-request.md b/legacy/doc/models/list-payout-entries-request.md new file mode 100644 index 000000000..87441789d --- /dev/null +++ b/legacy/doc/models/list-payout-entries-request.md @@ -0,0 +1,25 @@ + +# List Payout Entries Request + +## Structure + +`ListPayoutEntriesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `sortOrder` | [`string \| undefined`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | +| `cursor` | `string \| null \| undefined` | Optional | 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` | `number \| null \| undefined` | Optional | 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` | + +## Example (as JSON) + +```json +{ + "sort_order": "DESC", + "cursor": "cursor2", + "limit": 194 +} +``` + diff --git a/legacy/doc/models/list-payout-entries-response.md b/legacy/doc/models/list-payout-entries-response.md new file mode 100644 index 000000000..f09ce2932 --- /dev/null +++ b/legacy/doc/models/list-payout-entries-response.md @@ -0,0 +1,84 @@ + +# List Payout Entries Response + +The response to retrieve payout records entries. + +## Structure + +`ListPayoutEntriesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `payoutEntries` | [`PayoutEntry[] \| undefined`](../../doc/models/payout-entry.md) | Optional | The requested list of payout entries, ordered with the given or default sort order. | +| `cursor` | `string \| undefined` | Optional | 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` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | + +## Example (as JSON) + +```json +{ + "cursor": "TbfI80z98Xc2LdApCyZ2NvCYLpkPurYLR16GRIttpMJ55mrSIMzHgtkcRQdT0mOnTtfHO", + "payout_entries": [ + { + "effective_at": "2021-12-14T23:31:49Z", + "fee_amount_money": { + "amount": -2, + "currency_code": "USD", + "currency": "CHF" + }, + "gross_amount_money": { + "amount": -50, + "currency_code": "USD", + "currency": "MNT" + }, + "id": "poe_ZQWcw41d0SGJS6IWd4cSi8mKHk", + "net_amount_money": { + "amount": -48, + "currency_code": "USD", + "currency": "XPT" + }, + "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", + "currency": "CHF" + }, + "gross_amount_money": { + "amount": 100, + "currency_code": "USD", + "currency": "MNT" + }, + "id": "poe_EibbY9Ob1d0SGJS6IWd4cSiSi6wkaPk", + "net_amount_money": { + "amount": 81, + "currency_code": "USD", + "currency": "XPT" + }, + "payout_id": "po_4d28e6c4-7dd5-4de4-8ec9-a059277646a6", + "type": "CHARGE", + "type_charge_details": { + "payment_id": "HVdG62H5K3291d0SGJS6IWd4cSi8YY" + } + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/list-payouts-request.md b/legacy/doc/models/list-payouts-request.md new file mode 100644 index 000000000..24a4e1c20 --- /dev/null +++ b/legacy/doc/models/list-payouts-request.md @@ -0,0 +1,33 @@ + +# List Payouts Request + +A request to retrieve payout records. + +## Structure + +`ListPayoutsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `255` | +| `status` | [`string \| undefined`](../../doc/models/payout-status.md) | Optional | Payout status types | +| `beginTime` | `string \| null \| undefined` | Optional | The timestamp for the beginning of the payout creation time, in RFC 3339 format.
Inclusive. Default: The current time minus one year. | +| `endTime` | `string \| null \| undefined` | Optional | The timestamp for the end of the payout creation time, in RFC 3339 format.
Default: The current time. | +| `sortOrder` | [`string \| undefined`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | +| `cursor` | `string \| null \| undefined` | Optional | 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` | `number \| null \| undefined` | Optional | 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` | + +## Example (as JSON) + +```json +{ + "location_id": "location_id4", + "status": "SENT", + "begin_time": "begin_time2", + "end_time": "end_time2", + "sort_order": "DESC" +} +``` + diff --git a/legacy/doc/models/list-payouts-response.md b/legacy/doc/models/list-payouts-response.md new file mode 100644 index 000000000..a6ef97a35 --- /dev/null +++ b/legacy/doc/models/list-payouts-response.md @@ -0,0 +1,97 @@ + +# List Payouts Response + +The response to retrieve payout records entries. + +## Structure + +`ListPayoutsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `payouts` | [`Payout[] \| undefined`](../../doc/models/payout.md) | Optional | The requested list of payouts. | +| `cursor` | `string \| undefined` | Optional | 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` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | + +## Example (as JSON) + +```json +{ + "cursor": "EMPCyStibo64hS8wLayZPp3oedR3AeEUNd3z7u6zphi72LQZFIEMbkKVvot9eefpU", + "payouts": [ + { + "amount_money": { + "amount": 6259, + "currency_code": "USD", + "currency": "AUD" + }, + "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", + "currency": "AUD" + }, + "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 + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/list-refunds-request.md b/legacy/doc/models/list-refunds-request.md new file mode 100644 index 000000000..06d726db9 --- /dev/null +++ b/legacy/doc/models/list-refunds-request.md @@ -0,0 +1,32 @@ + +# List Refunds Request + +Defines the query parameters that can be included in +a request to the [ListRefunds](api-endpoint:Transactions-ListRefunds) endpoint. + +Deprecated - recommend using [SearchOrders](api-endpoint:Orders-SearchOrders) + +## Structure + +`ListRefundsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `beginTime` | `string \| null \| undefined` | Optional | 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. | +| `endTime` | `string \| null \| undefined` | Optional | 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. | +| `sortOrder` | [`string \| undefined`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | +| `cursor` | `string \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "begin_time": "begin_time6", + "end_time": "end_time0", + "sort_order": "DESC", + "cursor": "cursor8" +} +``` + diff --git a/legacy/doc/models/list-refunds-response.md b/legacy/doc/models/list-refunds-response.md new file mode 100644 index 000000000..2dfdf5ded --- /dev/null +++ b/legacy/doc/models/list-refunds-response.md @@ -0,0 +1,66 @@ + +# List Refunds Response + +Defines the fields that are included in the response body of +a request to the [ListRefunds](api-endpoint:Transactions-ListRefunds) endpoint. + +One of `errors` or `refunds` is present in a given response (never both). + +## Structure + +`ListRefundsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `refunds` | [`Refund[] \| undefined`](../../doc/models/refund.md) | Optional | An array of refunds that match your query. | +| `cursor` | `string \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "refunds": [ + { + "additional_recipients": [ + { + "amount_money": { + "amount": 10, + "currency": "USD" + }, + "description": "Application fees", + "location_id": "057P5VYJ4A5X1", + "receivable_id": "receivable_id6" + } + ], + "amount_money": { + "amount": 100, + "currency": "USD" + }, + "created_at": "2016-01-20T00:28:18Z", + "id": "b27436d1-7f8e-5610-45c6-417ef71434b4-SW", + "location_id": "18YC4JDH91E1H", + "reason": "some reason", + "status": "APPROVED", + "tender_id": "MtZRYYdDrYNQbOvV7nbuBvMF", + "transaction_id": "KnL67ZIwXCPtzOrqj0HrkxMF", + "processing_fee_money": { + "amount": 112, + "currency": "DJF" + } + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "cursor": "cursor8" +} +``` + diff --git a/legacy/doc/models/list-sites-response.md b/legacy/doc/models/list-sites-response.md new file mode 100644 index 000000000..07cd72ce4 --- /dev/null +++ b/legacy/doc/models/list-sites-response.md @@ -0,0 +1,49 @@ + +# List Sites Response + +Represents a `ListSites` response. The response can include either `sites` or `errors`. + +## Structure + +`ListSitesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `sites` | [`Site[] \| undefined`](../../doc/models/site.md) | Optional | The sites that belong to the seller. | + +## Example (as JSON) + +```json +{ + "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" + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/list-subscription-events-request.md b/legacy/doc/models/list-subscription-events-request.md new file mode 100644 index 000000000..34e7f4d8e --- /dev/null +++ b/legacy/doc/models/list-subscription-events-request.md @@ -0,0 +1,27 @@ + +# List Subscription Events Request + +Defines input parameters in a request to the +[ListSubscriptionEvents](../../doc/api/subscriptions.md#list-subscription-events) +endpoint. + +## Structure + +`ListSubscriptionEventsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `cursor` | `string \| null \| undefined` | Optional | 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` | `number \| null \| undefined` | Optional | The upper limit on the number of subscription events to return
in a paged response.
**Constraints**: `>= 1` | + +## Example (as JSON) + +```json +{ + "cursor": "cursor8", + "limit": 182 +} +``` + diff --git a/legacy/doc/models/list-subscription-events-response.md b/legacy/doc/models/list-subscription-events-response.md new file mode 100644 index 000000000..4b0d5a1a3 --- /dev/null +++ b/legacy/doc/models/list-subscription-events-response.md @@ -0,0 +1,169 @@ + +# List Subscription Events Response + +Defines output parameters in a response from the +[ListSubscriptionEvents](../../doc/api/subscriptions.md#list-subscription-events). + +## Structure + +`ListSubscriptionEventsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Errors encountered during the request. | +| `subscriptionEvents` | [`SubscriptionEvent[] \| undefined`](../../doc/models/subscription-event.md) | Optional | The retrieved subscription events. | +| `cursor` | `string \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "subscription_events": [ + { + "effective_date": "2020-04-24", + "id": "06809161-3867-4598-8269-8aea5be4f9de", + "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", + "subscription_event_type": "START_SUBSCRIPTION", + "monthly_billing_anchor_date": 16, + "info": { + "detail": "detail6", + "code": "CUSTOMER_DELETED" + }, + "phases": [ + { + "uid": "uid0", + "ordinal": 78, + "order_template_id": "order_template_id2", + "plan_phase_uid": "plan_phase_uid6" + } + ] + }, + { + "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", + "monthly_billing_anchor_date": 16, + "phases": [ + { + "uid": "uid0", + "ordinal": 78, + "order_template_id": "order_template_id2", + "plan_phase_uid": "plan_phase_uid6" + } + ] + }, + { + "effective_date": "2022-05-01", + "id": "b426fc85-6859-450b-b0d0-fe3a5d1b565f", + "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", + "subscription_event_type": "RESUME_SUBSCRIPTION", + "monthly_billing_anchor_date": 16, + "info": { + "detail": "detail6", + "code": "CUSTOMER_DELETED" + }, + "phases": [ + { + "uid": "uid0", + "ordinal": 78, + "order_template_id": "order_template_id2", + "plan_phase_uid": "plan_phase_uid6" + } + ] + }, + { + "effective_date": "2022-09-01", + "id": "09f14de1-2f53-4dae-9091-49aa53f83d01", + "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", + "subscription_event_type": "PAUSE_SUBSCRIPTION", + "monthly_billing_anchor_date": 16, + "info": { + "detail": "detail6", + "code": "CUSTOMER_DELETED" + }, + "phases": [ + { + "uid": "uid0", + "ordinal": 78, + "order_template_id": "order_template_id2", + "plan_phase_uid": "plan_phase_uid6" + } + ] + }, + { + "effective_date": "2022-12-01", + "id": "f28a73ac-1a1b-4b0f-8eeb-709a72945776", + "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", + "subscription_event_type": "RESUME_SUBSCRIPTION", + "monthly_billing_anchor_date": 16, + "info": { + "detail": "detail6", + "code": "CUSTOMER_DELETED" + }, + "phases": [ + { + "uid": "uid0", + "ordinal": 78, + "order_template_id": "order_template_id2", + "plan_phase_uid": "plan_phase_uid6" + } + ] + }, + { + "effective_date": "2023-04-01", + "id": "1eee8790-472d-4efe-8c69-8ad84e9cefe0", + "plan_variation_id": "02CD53CFA4d1498AFAD42", + "subscription_event_type": "PLAN_CHANGE", + "monthly_billing_anchor_date": 16, + "info": { + "detail": "detail6", + "code": "CUSTOMER_DELETED" + }, + "phases": [ + { + "uid": "uid0", + "ordinal": 78, + "order_template_id": "order_template_id2", + "plan_phase_uid": "plan_phase_uid6" + } + ] + }, + { + "effective_date": "2023-06-21", + "id": "a0c08083-5db0-4800-85c7-d398de4fbb6e", + "plan_variation_id": "6JHXF3B2CW3YKHDV4XEM674H", + "subscription_event_type": "STOP_SUBSCRIPTION", + "monthly_billing_anchor_date": 16, + "info": { + "detail": "detail6", + "code": "CUSTOMER_DELETED" + }, + "phases": [ + { + "uid": "uid0", + "ordinal": 78, + "order_template_id": "order_template_id2", + "plan_phase_uid": "plan_phase_uid6" + } + ] + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "cursor": "cursor4" +} +``` + diff --git a/legacy/doc/models/list-team-member-booking-profiles-request.md b/legacy/doc/models/list-team-member-booking-profiles-request.md new file mode 100644 index 000000000..92dc20090 --- /dev/null +++ b/legacy/doc/models/list-team-member-booking-profiles-request.md @@ -0,0 +1,27 @@ + +# List Team Member Booking Profiles Request + +## Structure + +`ListTeamMemberBookingProfilesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `bookableOnly` | `boolean \| null \| undefined` | Optional | Indicates whether to include only bookable team members in the returned result (`true`) or not (`false`). | +| `limit` | `number \| null \| undefined` | Optional | The maximum number of results to return in a paged response.
**Constraints**: `>= 1`, `<= 100` | +| `cursor` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `65536` | +| `locationId` | `string \| null \| undefined` | Optional | Indicates whether to include only team members enabled at the given location in the returned result.
**Constraints**: *Maximum Length*: `32` | + +## Example (as JSON) + +```json +{ + "bookable_only": false, + "limit": 112, + "cursor": "cursor2", + "location_id": "location_id8" +} +``` + diff --git a/legacy/doc/models/list-team-member-booking-profiles-response.md b/legacy/doc/models/list-team-member-booking-profiles-response.md new file mode 100644 index 000000000..365ac2319 --- /dev/null +++ b/legacy/doc/models/list-team-member-booking-profiles-response.md @@ -0,0 +1,40 @@ + +# List Team Member Booking Profiles Response + +## Structure + +`ListTeamMemberBookingProfilesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `teamMemberBookingProfiles` | [`TeamMemberBookingProfile[] \| undefined`](../../doc/models/team-member-booking-profile.md) | Optional | 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` | `string \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `65536` | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "errors": [], + "team_member_booking_profiles": [ + { + "display_name": "Sandbox Seller", + "is_bookable": true, + "team_member_id": "TMXUrsBWWcHTt79t", + "description": "description4", + "profile_image_url": "profile_image_url2" + }, + { + "display_name": "Sandbox Staff", + "is_bookable": true, + "team_member_id": "TMaJcbiRqPIGZuS9", + "description": "description4", + "profile_image_url": "profile_image_url2" + } + ], + "cursor": "cursor0" +} +``` + diff --git a/legacy/doc/models/list-team-member-wages-request.md b/legacy/doc/models/list-team-member-wages-request.md new file mode 100644 index 000000000..6791f9bbb --- /dev/null +++ b/legacy/doc/models/list-team-member-wages-request.md @@ -0,0 +1,27 @@ + +# List Team Member Wages Request + +A request for a set of `TeamMemberWage` objects. + +## Structure + +`ListTeamMemberWagesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `teamMemberId` | `string \| null \| undefined` | Optional | Filter the returned wages to only those that are associated with the
specified team member. | +| `limit` | `number \| null \| undefined` | Optional | The maximum number of `TeamMemberWage` results to return per page. The number can range between
1 and 200. The default is 200.
**Constraints**: `>= 1`, `<= 200` | +| `cursor` | `string \| null \| undefined` | Optional | A pointer to the next page of `EmployeeWage` results to fetch. | + +## Example (as JSON) + +```json +{ + "team_member_id": "team_member_id2", + "limit": 210, + "cursor": "cursor8" +} +``` + diff --git a/legacy/doc/models/list-team-member-wages-response.md b/legacy/doc/models/list-team-member-wages-response.md new file mode 100644 index 000000000..e93d4f787 --- /dev/null +++ b/legacy/doc/models/list-team-member-wages-response.md @@ -0,0 +1,86 @@ + +# List Team Member Wages Response + +The response to a request for a set of `TeamMemberWage` objects. The response contains +a set of `TeamMemberWage` objects. + +## Structure + +`ListTeamMemberWagesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `teamMemberWages` | [`TeamMemberWage[] \| undefined`](../../doc/models/team-member-wage.md) | Optional | A page of `TeamMemberWage` results. | +| `cursor` | `string \| undefined` | Optional | The value supplied in the subsequent request to fetch the next page
of `TeamMemberWage` results. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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" + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/list-transactions-request.md b/legacy/doc/models/list-transactions-request.md new file mode 100644 index 000000000..1fcd75981 --- /dev/null +++ b/legacy/doc/models/list-transactions-request.md @@ -0,0 +1,32 @@ + +# List Transactions Request + +Defines the query parameters that can be included in +a request to the [ListTransactions](api-endpoint:Transactions-ListTransactions) endpoint. + +Deprecated - recommend using [SearchOrders](api-endpoint:Orders-SearchOrders) + +## Structure + +`ListTransactionsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `beginTime` | `string \| null \| undefined` | Optional | 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. | +| `endTime` | `string \| null \| undefined` | Optional | 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. | +| `sortOrder` | [`string \| undefined`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | +| `cursor` | `string \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "begin_time": "begin_time6", + "end_time": "end_time0", + "sort_order": "DESC", + "cursor": "cursor8" +} +``` + diff --git a/legacy/doc/models/list-transactions-response.md b/legacy/doc/models/list-transactions-response.md new file mode 100644 index 000000000..a0f98e7ad --- /dev/null +++ b/legacy/doc/models/list-transactions-response.md @@ -0,0 +1,111 @@ + +# List Transactions Response + +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). + +## Structure + +`ListTransactionsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `transactions` | [`Transaction[] \| undefined`](../../doc/models/transaction.md) | Optional | An array of transactions that match your query. | +| `cursor` | `string \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "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", + "receivable_id": "receivable_id6" + } + ], + "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" + } + ] + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "cursor": "cursor8" +} +``` + diff --git a/legacy/doc/models/list-webhook-event-types-request.md b/legacy/doc/models/list-webhook-event-types-request.md new file mode 100644 index 000000000..f72e868c5 --- /dev/null +++ b/legacy/doc/models/list-webhook-event-types-request.md @@ -0,0 +1,23 @@ + +# List Webhook Event Types Request + +Lists all webhook event types that can be subscribed to. + +## Structure + +`ListWebhookEventTypesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `apiVersion` | `string \| null \| undefined` | Optional | The API version for which to list event types. Setting this field overrides the default version used by the application. | + +## Example (as JSON) + +```json +{ + "api_version": "api_version0" +} +``` + diff --git a/legacy/doc/models/list-webhook-event-types-response.md b/legacy/doc/models/list-webhook-event-types-response.md new file mode 100644 index 000000000..78ecbf3f3 --- /dev/null +++ b/legacy/doc/models/list-webhook-event-types-response.md @@ -0,0 +1,46 @@ + +# List Webhook Event Types Response + +Defines the fields that are included in the response body of +a request to the [ListWebhookEventTypes](../../doc/api/webhook-subscriptions.md#list-webhook-event-types) endpoint. + +Note: if there are errors processing the request, the event types field will not be +present. + +## Structure + +`ListWebhookEventTypesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | +| `eventTypes` | `string[] \| undefined` | Optional | The list of event types. | +| `metadata` | [`EventTypeMetadata[] \| undefined`](../../doc/models/event-type-metadata.md) | Optional | Contains the metadata of a webhook event type. For more information, see [EventTypeMetadata](entity:EventTypeMetadata). | + +## Example (as JSON) + +```json +{ + "event_types": [ + "inventory.count.updated" + ], + "metadata": [ + { + "api_version_introduced": "2018-07-12", + "event_type": "inventory.count.updated", + "release_status": "PUBLIC" + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/list-webhook-subscriptions-request.md b/legacy/doc/models/list-webhook-subscriptions-request.md new file mode 100644 index 000000000..9b9fa225e --- /dev/null +++ b/legacy/doc/models/list-webhook-subscriptions-request.md @@ -0,0 +1,29 @@ + +# List Webhook Subscriptions Request + +Lists all [Subscription](../../doc/models/webhook-subscription.md)s owned by your application. + +## Structure + +`ListWebhookSubscriptionsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `cursor` | `string \| null \| undefined` | Optional | 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).
**Constraints**: *Maximum Length*: `256` | +| `includeDisabled` | `boolean \| null \| undefined` | Optional | Includes disabled [Subscription](entity:WebhookSubscription)s.
By default, all enabled [Subscription](entity:WebhookSubscription)s are returned. | +| `sortOrder` | [`string \| undefined`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | +| `limit` | `number \| null \| undefined` | Optional | 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
**Constraints**: `>= 1`, `<= 100` | + +## Example (as JSON) + +```json +{ + "cursor": "cursor2", + "include_disabled": false, + "sort_order": "DESC", + "limit": 190 +} +``` + diff --git a/legacy/doc/models/list-webhook-subscriptions-response.md b/legacy/doc/models/list-webhook-subscriptions-response.md new file mode 100644 index 000000000..ae758ffe2 --- /dev/null +++ b/legacy/doc/models/list-webhook-subscriptions-response.md @@ -0,0 +1,52 @@ + +# List Webhook Subscriptions Response + +Defines the fields that are included in the response body of +a request to the [ListWebhookSubscriptions](../../doc/api/webhook-subscriptions.md#list-webhook-subscriptions) endpoint. + +Note: if there are errors processing the request, the subscriptions field will not be +present. + +## Structure + +`ListWebhookSubscriptionsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | +| `subscriptions` | [`WebhookSubscription[] \| undefined`](../../doc/models/webhook-subscription.md) | Optional | The requested list of [Subscription](entity:WebhookSubscription)s. | +| `cursor` | `string \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "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" + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "cursor": "cursor6" +} +``` + diff --git a/legacy/doc/models/list-workweek-configs-request.md b/legacy/doc/models/list-workweek-configs-request.md new file mode 100644 index 000000000..cccf02937 --- /dev/null +++ b/legacy/doc/models/list-workweek-configs-request.md @@ -0,0 +1,25 @@ + +# List Workweek Configs Request + +A request for a set of `WorkweekConfig` objects. + +## Structure + +`ListWorkweekConfigsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `limit` | `number \| null \| undefined` | Optional | The maximum number of `WorkweekConfigs` results to return per page. | +| `cursor` | `string \| null \| undefined` | Optional | A pointer to the next page of `WorkweekConfig` results to fetch. | + +## Example (as JSON) + +```json +{ + "limit": 98, + "cursor": "cursor0" +} +``` + diff --git a/legacy/doc/models/list-workweek-configs-response.md b/legacy/doc/models/list-workweek-configs-response.md new file mode 100644 index 000000000..3ff668a1f --- /dev/null +++ b/legacy/doc/models/list-workweek-configs-response.md @@ -0,0 +1,45 @@ + +# List Workweek Configs Response + +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. + +## Structure + +`ListWorkweekConfigsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `workweekConfigs` | [`WorkweekConfig[] \| undefined`](../../doc/models/workweek-config.md) | Optional | A page of `WorkweekConfig` results. | +| `cursor` | `string \| undefined` | Optional | The value supplied in the subsequent request to fetch the next page of
`WorkweekConfig` results. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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 + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/location-booking-profile.md b/legacy/doc/models/location-booking-profile.md new file mode 100644 index 000000000..6e37dd338 --- /dev/null +++ b/legacy/doc/models/location-booking-profile.md @@ -0,0 +1,27 @@ + +# Location Booking Profile + +The booking profile of a seller's location, including the location's ID and whether the location is enabled for online booking. + +## Structure + +`LocationBookingProfile` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string \| null \| undefined` | Optional | The ID of the [location](entity:Location). | +| `bookingSiteUrl` | `string \| null \| undefined` | Optional | Url for the online booking site for this location. | +| `onlineBookingEnabled` | `boolean \| null \| undefined` | Optional | Indicates whether the location is enabled for online booking. | + +## Example (as JSON) + +```json +{ + "location_id": "location_id8", + "booking_site_url": "booking_site_url4", + "online_booking_enabled": false +} +``` + diff --git a/legacy/doc/models/location-capability.md b/legacy/doc/models/location-capability.md new file mode 100644 index 000000000..bed5e30e7 --- /dev/null +++ b/legacy/doc/models/location-capability.md @@ -0,0 +1,17 @@ + +# Location Capability + +The capabilities a location might have. + +## Enumeration + +`LocationCapability` + +## Fields + +| Name | Description | +| --- | --- | +| `CREDIT_CARD_PROCESSING` | The capability to process credit card transactions with Square. | +| `AUTOMATIC_TRANSFERS` | The capability to receive automatic transfers from Square. | +| `UNLINKED_REFUNDS` | The capability to process unlinked refunds with Square. | + diff --git a/legacy/doc/models/location-status.md b/legacy/doc/models/location-status.md new file mode 100644 index 000000000..3edf1db75 --- /dev/null +++ b/legacy/doc/models/location-status.md @@ -0,0 +1,16 @@ + +# Location Status + +A location's status. + +## Enumeration + +`LocationStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `ACTIVE` | A location that is active for business. | +| `INACTIVE` | A location that is not active for business. Inactive locations provide historical
information. Hide inactive locations unless the user has requested to see them. | + diff --git a/legacy/doc/models/location-type.md b/legacy/doc/models/location-type.md new file mode 100644 index 000000000..5aaf34afb --- /dev/null +++ b/legacy/doc/models/location-type.md @@ -0,0 +1,16 @@ + +# Location Type + +A location's type. + +## Enumeration + +`LocationType` + +## Fields + +| Name | Description | +| --- | --- | +| `PHYSICAL` | A place of business with a physical location. | +| `MOBILE` | A place of business that is mobile, such as a food truck or online store. | + diff --git a/legacy/doc/models/location.md b/legacy/doc/models/location.md new file mode 100644 index 000000000..6475f6eb3 --- /dev/null +++ b/legacy/doc/models/location.md @@ -0,0 +1,61 @@ + +# Location + +Represents one of a business' [locations](https://developer.squareup.com/docs/locations-api). + +## Structure + +`Location` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | A short generated string of letters and numbers that uniquely identifies this location instance.
**Constraints**: *Maximum Length*: `32` | +| `name` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `255` | +| `address` | [`Address \| undefined`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | +| `timezone` | `string \| null \| undefined` | Optional | The [IANA time zone](https://www.iana.org/time-zones) identifier for
the time zone of the location. For example, `America/Los_Angeles`.
**Constraints**: *Maximum Length*: `30` | +| `capabilities` | [`string[] \| undefined`](../../doc/models/location-capability.md) | Optional | The Square features that are enabled for the location.
See [LocationCapability](entity:LocationCapability) for possible values.
See [LocationCapability](#type-locationcapability) for possible values | +| `status` | [`string \| undefined`](../../doc/models/location-status.md) | Optional | A location's status. | +| `createdAt` | `string \| undefined` | Optional | 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).
**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `25` | +| `merchantId` | `string \| undefined` | Optional | The ID of the merchant that owns the location.
**Constraints**: *Maximum Length*: `32` | +| `country` | [`string \| undefined`](../../doc/models/country.md) | Optional | 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). | +| `languageCode` | `string \| null \| undefined` | Optional | 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).
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `5` | +| `currency` | [`string \| undefined`](../../doc/models/currency.md) | Optional | Indicates the associated currency for an amount of money. Values correspond
to [ISO 4217](https://wikipedia.org/wiki/ISO_4217). | +| `phoneNumber` | `string \| null \| undefined` | Optional | The phone number of the location. For example, `+1 855-700-6000`.
**Constraints**: *Maximum Length*: `17` | +| `businessName` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `255` | +| `type` | [`string \| undefined`](../../doc/models/location-type.md) | Optional | A location's type. | +| `websiteUrl` | `string \| null \| undefined` | Optional | The website URL of the location. For example, `https://squareup.com`.
**Constraints**: *Maximum Length*: `255` | +| `businessHours` | [`BusinessHours \| undefined`](../../doc/models/business-hours.md) | Optional | The hours of operation for a location. | +| `businessEmail` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `255` | +| `description` | `string \| null \| undefined` | Optional | The description of the location. For example, `Main Street location`.
**Constraints**: *Maximum Length*: `1024` | +| `twitterUsername` | `string \| null \| undefined` | Optional | The Twitter username of the location without the '@' symbol. For example, `Square`.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `15` | +| `instagramUsername` | `string \| null \| undefined` | Optional | The Instagram username of the location without the '@' symbol. For example, `square`.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `30` | +| `facebookUrl` | `string \| null \| undefined` | Optional | The Facebook profile URL of the location. The URL should begin with 'facebook.com/'. For example, `https://www.facebook.com/square`.
**Constraints**: *Maximum Length*: `255` | +| `coordinates` | [`Coordinates \| undefined`](../../doc/models/coordinates.md) | Optional | Latitude and longitude coordinates. | +| `logoUrl` | `string \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `255` | +| `posBackgroundUrl` | `string \| undefined` | Optional | The URL of the Point of Sale background image for the location.
**Constraints**: *Maximum Length*: `255` | +| `mcc` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Minimum Length*: `4`, *Maximum Length*: `4` | +| `fullFormatLogoUrl` | `string \| undefined` | Optional | 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. | +| `taxIds` | [`TaxIds \| undefined`](../../doc/models/tax-ids.md) | Optional | Identifiers for the location used by various governments for tax purposes. | + +## Example (as JSON) + +```json +{ + "id": "id4", + "name": "name4", + "address": { + "address_line_1": "address_line_16", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "locality": "locality6", + "sublocality": "sublocality6" + }, + "timezone": "timezone4", + "capabilities": [ + "CREDIT_CARD_PROCESSING" + ] +} +``` + diff --git a/legacy/doc/models/loyalty-account-expiring-point-deadline.md b/legacy/doc/models/loyalty-account-expiring-point-deadline.md new file mode 100644 index 000000000..d5da193cb --- /dev/null +++ b/legacy/doc/models/loyalty-account-expiring-point-deadline.md @@ -0,0 +1,25 @@ + +# Loyalty Account Expiring Point Deadline + +Represents a set of points for a loyalty account that are scheduled to expire on a specific date. + +## Structure + +`LoyaltyAccountExpiringPointDeadline` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `points` | `number` | Required | The number of points scheduled to expire at the `expires_at` timestamp. | +| `expiresAt` | `string` | Required | The timestamp of when the points are scheduled to expire, in RFC 3339 format.
**Constraints**: *Minimum Length*: `1` | + +## Example (as JSON) + +```json +{ + "points": 104, + "expires_at": "expires_at6" +} +``` + diff --git a/legacy/doc/models/loyalty-account-mapping-type.md b/legacy/doc/models/loyalty-account-mapping-type.md new file mode 100644 index 000000000..1367bd913 --- /dev/null +++ b/legacy/doc/models/loyalty-account-mapping-type.md @@ -0,0 +1,15 @@ + +# Loyalty Account Mapping Type + +The type of mapping. + +## Enumeration + +`LoyaltyAccountMappingType` + +## Fields + +| Name | Description | +| --- | --- | +| `PHONE` | The loyalty account is mapped by phone. | + diff --git a/legacy/doc/models/loyalty-account-mapping.md b/legacy/doc/models/loyalty-account-mapping.md new file mode 100644 index 000000000..97a9f5315 --- /dev/null +++ b/legacy/doc/models/loyalty-account-mapping.md @@ -0,0 +1,30 @@ + +# Loyalty Account Mapping + +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). + +## Structure + +`LoyaltyAccountMapping` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | The Square-assigned ID of the mapping.
**Constraints**: *Maximum Length*: `36` | +| `createdAt` | `string \| undefined` | Optional | The timestamp when the mapping was created, in RFC 3339 format. | +| `phoneNumber` | `string \| null \| undefined` | Optional | The phone number of the buyer, in E.164 format. For example, "+14155551111". | + +## Example (as JSON) + +```json +{ + "id": "id2", + "created_at": "created_at0", + "phone_number": "phone_number0" +} +``` + diff --git a/legacy/doc/models/loyalty-account.md b/legacy/doc/models/loyalty-account.md new file mode 100644 index 000000000..04a347607 --- /dev/null +++ b/legacy/doc/models/loyalty-account.md @@ -0,0 +1,38 @@ + +# Loyalty Account + +Describes a loyalty account in a [loyalty program](../../doc/models/loyalty-program.md). For more information, see +[Create and Retrieve Loyalty Accounts](https://developer.squareup.com/docs/loyalty-api/loyalty-accounts). + +## Structure + +`LoyaltyAccount` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | The Square-assigned ID of the loyalty account.
**Constraints**: *Maximum Length*: `36` | +| `programId` | `string` | Required | The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram) to which the account belongs.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | +| `balance` | `number \| undefined` | Optional | 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. | +| `lifetimePoints` | `number \| undefined` | Optional | The total points accrued during the lifetime of the account. | +| `customerId` | `string \| null \| undefined` | Optional | The Square-assigned ID of the [customer](entity:Customer) that is associated with the account. | +| `enrolledAt` | `string \| null \| undefined` | Optional | 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 in Square Point of Sale.

This field is typically specified in a `CreateLoyaltyAccount` request when creating a loyalty account for a buyer who already interacted with their account.
For example, you would set this field when migrating accounts from an external system. The timestamp in the request can represent a current or previous date and time, but it cannot be set for the future. | +| `createdAt` | `string \| undefined` | Optional | The timestamp when the loyalty account was created, in RFC 3339 format. | +| `updatedAt` | `string \| undefined` | Optional | The timestamp when the loyalty account was last updated, in RFC 3339 format. | +| `mapping` | [`LoyaltyAccountMapping \| undefined`](../../doc/models/loyalty-account-mapping.md) | Optional | 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). | +| `expiringPointDeadlines` | [`LoyaltyAccountExpiringPointDeadline[] \| null \| undefined`](../../doc/models/loyalty-account-expiring-point-deadline.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "id": "id4", + "program_id": "program_id6", + "balance": 52, + "lifetime_points": 76, + "customer_id": "customer_id2", + "enrolled_at": "enrolled_at4" +} +``` + diff --git a/legacy/doc/models/loyalty-event-accumulate-points.md b/legacy/doc/models/loyalty-event-accumulate-points.md new file mode 100644 index 000000000..aac0b1acb --- /dev/null +++ b/legacy/doc/models/loyalty-event-accumulate-points.md @@ -0,0 +1,27 @@ + +# Loyalty Event Accumulate Points + +Provides metadata when the event `type` is `ACCUMULATE_POINTS`. + +## Structure + +`LoyaltyEventAccumulatePoints` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `loyaltyProgramId` | `string \| undefined` | Optional | The ID of the [loyalty program](entity:LoyaltyProgram).
**Constraints**: *Maximum Length*: `36` | +| `points` | `number \| null \| undefined` | Optional | The number of points accumulated by the event.
**Constraints**: `>= 1` | +| `orderId` | `string \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "loyalty_program_id": "loyalty_program_id0", + "points": 104, + "order_id": "order_id4" +} +``` + diff --git a/legacy/doc/models/loyalty-event-accumulate-promotion-points.md b/legacy/doc/models/loyalty-event-accumulate-promotion-points.md new file mode 100644 index 000000000..6db43e359 --- /dev/null +++ b/legacy/doc/models/loyalty-event-accumulate-promotion-points.md @@ -0,0 +1,29 @@ + +# Loyalty Event Accumulate Promotion Points + +Provides metadata when the event `type` is `ACCUMULATE_PROMOTION_POINTS`. + +## Structure + +`LoyaltyEventAccumulatePromotionPoints` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `loyaltyProgramId` | `string \| undefined` | Optional | The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram).
**Constraints**: *Maximum Length*: `36` | +| `loyaltyPromotionId` | `string \| undefined` | Optional | The Square-assigned ID of the [loyalty promotion](entity:LoyaltyPromotion).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | +| `points` | `number` | Required | The number of points earned by the event. | +| `orderId` | `string` | Required | 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.
**Constraints**: *Minimum Length*: `1` | + +## Example (as JSON) + +```json +{ + "loyalty_program_id": "loyalty_program_id0", + "loyalty_promotion_id": "loyalty_promotion_id8", + "points": 98, + "order_id": "order_id4" +} +``` + diff --git a/legacy/doc/models/loyalty-event-adjust-points.md b/legacy/doc/models/loyalty-event-adjust-points.md new file mode 100644 index 000000000..db809f4a7 --- /dev/null +++ b/legacy/doc/models/loyalty-event-adjust-points.md @@ -0,0 +1,27 @@ + +# Loyalty Event Adjust Points + +Provides metadata when the event `type` is `ADJUST_POINTS`. + +## Structure + +`LoyaltyEventAdjustPoints` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `loyaltyProgramId` | `string \| undefined` | Optional | The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram).
**Constraints**: *Maximum Length*: `36` | +| `points` | `number` | Required | The number of points added or removed. | +| `reason` | `string \| null \| undefined` | Optional | The reason for the adjustment of points. | + +## Example (as JSON) + +```json +{ + "loyalty_program_id": "loyalty_program_id4", + "points": 98, + "reason": "reason0" +} +``` + diff --git a/legacy/doc/models/loyalty-event-create-reward.md b/legacy/doc/models/loyalty-event-create-reward.md new file mode 100644 index 000000000..286bf2162 --- /dev/null +++ b/legacy/doc/models/loyalty-event-create-reward.md @@ -0,0 +1,27 @@ + +# Loyalty Event Create Reward + +Provides metadata when the event `type` is `CREATE_REWARD`. + +## Structure + +`LoyaltyEventCreateReward` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `loyaltyProgramId` | `string` | Required | The ID of the [loyalty program](entity:LoyaltyProgram).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | +| `rewardId` | `string \| undefined` | Optional | The Square-assigned ID of the created [loyalty reward](entity:LoyaltyReward).
This field is returned only if the event source is `LOYALTY_API`.
**Constraints**: *Maximum Length*: `36` | +| `points` | `number` | Required | The loyalty points used to create the reward. | + +## Example (as JSON) + +```json +{ + "loyalty_program_id": "loyalty_program_id4", + "reward_id": "reward_id8", + "points": 198 +} +``` + diff --git a/legacy/doc/models/loyalty-event-date-time-filter.md b/legacy/doc/models/loyalty-event-date-time-filter.md new file mode 100644 index 000000000..57dc6e391 --- /dev/null +++ b/legacy/doc/models/loyalty-event-date-time-filter.md @@ -0,0 +1,26 @@ + +# Loyalty Event Date Time Filter + +Filter events by date time range. + +## Structure + +`LoyaltyEventDateTimeFilter` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `createdAt` | [`TimeRange`](../../doc/models/time-range.md) | Required | 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. | + +## Example (as JSON) + +```json +{ + "created_at": { + "start_at": "start_at4", + "end_at": "end_at8" + } +} +``` + diff --git a/legacy/doc/models/loyalty-event-delete-reward.md b/legacy/doc/models/loyalty-event-delete-reward.md new file mode 100644 index 000000000..d8d42b4ac --- /dev/null +++ b/legacy/doc/models/loyalty-event-delete-reward.md @@ -0,0 +1,27 @@ + +# Loyalty Event Delete Reward + +Provides metadata when the event `type` is `DELETE_REWARD`. + +## Structure + +`LoyaltyEventDeleteReward` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `loyaltyProgramId` | `string` | Required | The ID of the [loyalty program](entity:LoyaltyProgram).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | +| `rewardId` | `string \| undefined` | Optional | The ID of the deleted [loyalty reward](entity:LoyaltyReward).
This field is returned only if the event source is `LOYALTY_API`.
**Constraints**: *Maximum Length*: `36` | +| `points` | `number` | Required | The number of points returned to the loyalty account. | + +## Example (as JSON) + +```json +{ + "loyalty_program_id": "loyalty_program_id2", + "reward_id": "reward_id6", + "points": 84 +} +``` + diff --git a/legacy/doc/models/loyalty-event-expire-points.md b/legacy/doc/models/loyalty-event-expire-points.md new file mode 100644 index 000000000..0f4ee4ac9 --- /dev/null +++ b/legacy/doc/models/loyalty-event-expire-points.md @@ -0,0 +1,25 @@ + +# Loyalty Event Expire Points + +Provides metadata when the event `type` is `EXPIRE_POINTS`. + +## Structure + +`LoyaltyEventExpirePoints` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `loyaltyProgramId` | `string` | Required | The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | +| `points` | `number` | Required | The number of points expired. | + +## Example (as JSON) + +```json +{ + "loyalty_program_id": "loyalty_program_id8", + "points": 84 +} +``` + diff --git a/legacy/doc/models/loyalty-event-filter.md b/legacy/doc/models/loyalty-event-filter.md new file mode 100644 index 000000000..47874b7c4 --- /dev/null +++ b/legacy/doc/models/loyalty-event-filter.md @@ -0,0 +1,53 @@ + +# Loyalty Event Filter + +The filtering criteria. If the request specifies multiple filters, +the endpoint uses a logical AND to evaluate them. + +## Structure + +`LoyaltyEventFilter` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `loyaltyAccountFilter` | [`LoyaltyEventLoyaltyAccountFilter \| undefined`](../../doc/models/loyalty-event-loyalty-account-filter.md) | Optional | Filter events by loyalty account. | +| `typeFilter` | [`LoyaltyEventTypeFilter \| undefined`](../../doc/models/loyalty-event-type-filter.md) | Optional | Filter events by event type. | +| `dateTimeFilter` | [`LoyaltyEventDateTimeFilter \| undefined`](../../doc/models/loyalty-event-date-time-filter.md) | Optional | Filter events by date time range. | +| `locationFilter` | [`LoyaltyEventLocationFilter \| undefined`](../../doc/models/loyalty-event-location-filter.md) | Optional | Filter events by location. | +| `orderFilter` | [`LoyaltyEventOrderFilter \| undefined`](../../doc/models/loyalty-event-order-filter.md) | Optional | Filter events by the order associated with the event. | + +## Example (as JSON) + +```json +{ + "loyalty_account_filter": { + "loyalty_account_id": "loyalty_account_id8" + }, + "type_filter": { + "types": [ + "ACCUMULATE_PROMOTION_POINTS", + "ACCUMULATE_POINTS", + "CREATE_REWARD" + ] + }, + "date_time_filter": { + "created_at": { + "start_at": "start_at4", + "end_at": "end_at8" + } + }, + "location_filter": { + "location_ids": [ + "location_ids0", + "location_ids1", + "location_ids2" + ] + }, + "order_filter": { + "order_id": "order_id2" + } +} +``` + diff --git a/legacy/doc/models/loyalty-event-location-filter.md b/legacy/doc/models/loyalty-event-location-filter.md new file mode 100644 index 000000000..5d1c449be --- /dev/null +++ b/legacy/doc/models/loyalty-event-location-filter.md @@ -0,0 +1,27 @@ + +# Loyalty Event Location Filter + +Filter events by location. + +## Structure + +`LoyaltyEventLocationFilter` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationIds` | `string[]` | Required | The [location](entity:Location) IDs for loyalty events to query.
If multiple values are specified, the endpoint uses
a logical OR to combine them. | + +## Example (as JSON) + +```json +{ + "location_ids": [ + "location_ids6", + "location_ids7", + "location_ids8" + ] +} +``` + diff --git a/legacy/doc/models/loyalty-event-loyalty-account-filter.md b/legacy/doc/models/loyalty-event-loyalty-account-filter.md new file mode 100644 index 000000000..5a607409b --- /dev/null +++ b/legacy/doc/models/loyalty-event-loyalty-account-filter.md @@ -0,0 +1,23 @@ + +# Loyalty Event Loyalty Account Filter + +Filter events by loyalty account. + +## Structure + +`LoyaltyEventLoyaltyAccountFilter` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `loyaltyAccountId` | `string` | Required | The ID of the [loyalty account](entity:LoyaltyAccount) associated with loyalty events.
**Constraints**: *Minimum Length*: `1` | + +## Example (as JSON) + +```json +{ + "loyalty_account_id": "loyalty_account_id2" +} +``` + diff --git a/legacy/doc/models/loyalty-event-order-filter.md b/legacy/doc/models/loyalty-event-order-filter.md new file mode 100644 index 000000000..beec80714 --- /dev/null +++ b/legacy/doc/models/loyalty-event-order-filter.md @@ -0,0 +1,23 @@ + +# Loyalty Event Order Filter + +Filter events by the order associated with the event. + +## Structure + +`LoyaltyEventOrderFilter` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `orderId` | `string` | Required | The ID of the [order](entity:Order) associated with the event.
**Constraints**: *Minimum Length*: `1` | + +## Example (as JSON) + +```json +{ + "order_id": "order_id4" +} +``` + diff --git a/legacy/doc/models/loyalty-event-other.md b/legacy/doc/models/loyalty-event-other.md new file mode 100644 index 000000000..ab553d0e2 --- /dev/null +++ b/legacy/doc/models/loyalty-event-other.md @@ -0,0 +1,25 @@ + +# Loyalty Event Other + +Provides metadata when the event `type` is `OTHER`. + +## Structure + +`LoyaltyEventOther` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `loyaltyProgramId` | `string` | Required | The Square-assigned ID of the [loyalty program](entity:LoyaltyProgram).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | +| `points` | `number` | Required | The number of points added or removed. | + +## Example (as JSON) + +```json +{ + "loyalty_program_id": "loyalty_program_id4", + "points": 94 +} +``` + diff --git a/legacy/doc/models/loyalty-event-query.md b/legacy/doc/models/loyalty-event-query.md new file mode 100644 index 000000000..b6acffb4a --- /dev/null +++ b/legacy/doc/models/loyalty-event-query.md @@ -0,0 +1,50 @@ + +# Loyalty Event Query + +Represents a query used to search for loyalty events. + +## Structure + +`LoyaltyEventQuery` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `filter` | [`LoyaltyEventFilter \| undefined`](../../doc/models/loyalty-event-filter.md) | Optional | The filtering criteria. If the request specifies multiple filters,
the endpoint uses a logical AND to evaluate them. | + +## Example (as JSON) + +```json +{ + "filter": { + "loyalty_account_filter": { + "loyalty_account_id": "loyalty_account_id8" + }, + "type_filter": { + "types": [ + "ACCUMULATE_PROMOTION_POINTS", + "ACCUMULATE_POINTS", + "CREATE_REWARD" + ] + }, + "date_time_filter": { + "created_at": { + "start_at": "start_at4", + "end_at": "end_at8" + } + }, + "location_filter": { + "location_ids": [ + "location_ids0", + "location_ids1", + "location_ids2" + ] + }, + "order_filter": { + "order_id": "order_id2" + } + } +} +``` + diff --git a/legacy/doc/models/loyalty-event-redeem-reward.md b/legacy/doc/models/loyalty-event-redeem-reward.md new file mode 100644 index 000000000..214fcdaa1 --- /dev/null +++ b/legacy/doc/models/loyalty-event-redeem-reward.md @@ -0,0 +1,27 @@ + +# Loyalty Event Redeem Reward + +Provides metadata when the event `type` is `REDEEM_REWARD`. + +## Structure + +`LoyaltyEventRedeemReward` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `loyaltyProgramId` | `string` | Required | The ID of the [loyalty program](entity:LoyaltyProgram).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | +| `rewardId` | `string \| undefined` | Optional | The ID of the redeemed [loyalty reward](entity:LoyaltyReward).
This field is returned only if the event source is `LOYALTY_API`.
**Constraints**: *Maximum Length*: `36` | +| `orderId` | `string \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "loyalty_program_id": "loyalty_program_id4", + "reward_id": "reward_id8", + "order_id": "order_id8" +} +``` + diff --git a/legacy/doc/models/loyalty-event-source.md b/legacy/doc/models/loyalty-event-source.md new file mode 100644 index 000000000..4cfa3d592 --- /dev/null +++ b/legacy/doc/models/loyalty-event-source.md @@ -0,0 +1,16 @@ + +# Loyalty Event Source + +Defines whether the event was generated by the Square Point of Sale. + +## Enumeration + +`LoyaltyEventSource` + +## Fields + +| Name | Description | +| --- | --- | +| `SQUARE` | The event is generated by the Square Point of Sale (POS). | +| `LOYALTY_API` | The event is generated by something other than the Square Point of Sale that used the Loyalty API. | + diff --git a/legacy/doc/models/loyalty-event-type-filter.md b/legacy/doc/models/loyalty-event-type-filter.md new file mode 100644 index 000000000..dbd9ceca9 --- /dev/null +++ b/legacy/doc/models/loyalty-event-type-filter.md @@ -0,0 +1,27 @@ + +# Loyalty Event Type Filter + +Filter events by event type. + +## Structure + +`LoyaltyEventTypeFilter` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `types` | [`string[]`](../../doc/models/loyalty-event-type.md) | Required | 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 | + +## Example (as JSON) + +```json +{ + "types": [ + "EXPIRE_POINTS", + "OTHER", + "ACCUMULATE_PROMOTION_POINTS" + ] +} +``` + diff --git a/legacy/doc/models/loyalty-event-type.md b/legacy/doc/models/loyalty-event-type.md new file mode 100644 index 000000000..71364f4fc --- /dev/null +++ b/legacy/doc/models/loyalty-event-type.md @@ -0,0 +1,22 @@ + +# Loyalty Event Type + +The type of the loyalty event. + +## Enumeration + +`LoyaltyEventType` + +## Fields + +| Name | Description | +| --- | --- | +| `ACCUMULATE_POINTS` | Points are added to a loyalty account for a purchase that
qualified for points based on an [accrual rule](../../doc/models/loyalty-program-accrual-rule.md). | +| `CREATE_REWARD` | A [loyalty reward](../../doc/models/loyalty-reward.md) is created. | +| `REDEEM_REWARD` | A loyalty reward is redeemed. | +| `DELETE_REWARD` | A loyalty reward is deleted. | +| `ADJUST_POINTS` | Loyalty points are manually adjusted. | +| `EXPIRE_POINTS` | Loyalty points are expired according to the
expiration policy of the loyalty program. | +| `OTHER` | Some other loyalty event occurred. | +| `ACCUMULATE_PROMOTION_POINTS` | Points are added to a loyalty account for a purchase that
qualified for a [loyalty promotion](../../doc/models/loyalty-promotion.md). | + diff --git a/legacy/doc/models/loyalty-event.md b/legacy/doc/models/loyalty-event.md new file mode 100644 index 000000000..2674799b1 --- /dev/null +++ b/legacy/doc/models/loyalty-event.md @@ -0,0 +1,66 @@ + +# Loyalty Event + +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). + +## Structure + +`LoyaltyEvent` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string` | Required | The Square-assigned ID of the loyalty event.
**Constraints**: *Minimum Length*: `1` | +| `type` | [`string`](../../doc/models/loyalty-event-type.md) | Required | The type of the loyalty event. | +| `createdAt` | `string` | Required | The timestamp when the event was created, in RFC 3339 format.
**Constraints**: *Minimum Length*: `1` | +| `accumulatePoints` | [`LoyaltyEventAccumulatePoints \| undefined`](../../doc/models/loyalty-event-accumulate-points.md) | Optional | Provides metadata when the event `type` is `ACCUMULATE_POINTS`. | +| `createReward` | [`LoyaltyEventCreateReward \| undefined`](../../doc/models/loyalty-event-create-reward.md) | Optional | Provides metadata when the event `type` is `CREATE_REWARD`. | +| `redeemReward` | [`LoyaltyEventRedeemReward \| undefined`](../../doc/models/loyalty-event-redeem-reward.md) | Optional | Provides metadata when the event `type` is `REDEEM_REWARD`. | +| `deleteReward` | [`LoyaltyEventDeleteReward \| undefined`](../../doc/models/loyalty-event-delete-reward.md) | Optional | Provides metadata when the event `type` is `DELETE_REWARD`. | +| `adjustPoints` | [`LoyaltyEventAdjustPoints \| undefined`](../../doc/models/loyalty-event-adjust-points.md) | Optional | Provides metadata when the event `type` is `ADJUST_POINTS`. | +| `loyaltyAccountId` | `string` | Required | The ID of the [loyalty account](entity:LoyaltyAccount) associated with the event.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | +| `locationId` | `string \| undefined` | Optional | The ID of the [location](entity:Location) where the event occurred. | +| `source` | [`string`](../../doc/models/loyalty-event-source.md) | Required | Defines whether the event was generated by the Square Point of Sale. | +| `expirePoints` | [`LoyaltyEventExpirePoints \| undefined`](../../doc/models/loyalty-event-expire-points.md) | Optional | Provides metadata when the event `type` is `EXPIRE_POINTS`. | +| `otherEvent` | [`LoyaltyEventOther \| undefined`](../../doc/models/loyalty-event-other.md) | Optional | Provides metadata when the event `type` is `OTHER`. | +| `accumulatePromotionPoints` | [`LoyaltyEventAccumulatePromotionPoints \| undefined`](../../doc/models/loyalty-event-accumulate-promotion-points.md) | Optional | Provides metadata when the event `type` is `ACCUMULATE_PROMOTION_POINTS`. | + +## Example (as JSON) + +```json +{ + "id": "id0", + "type": "ACCUMULATE_POINTS", + "created_at": "created_at2", + "accumulate_points": { + "loyalty_program_id": "loyalty_program_id8", + "points": 118, + "order_id": "order_id8" + }, + "create_reward": { + "loyalty_program_id": "loyalty_program_id2", + "reward_id": "reward_id6", + "points": 90 + }, + "redeem_reward": { + "loyalty_program_id": "loyalty_program_id8", + "reward_id": "reward_id2", + "order_id": "order_id8" + }, + "delete_reward": { + "loyalty_program_id": "loyalty_program_id4", + "reward_id": "reward_id8", + "points": 104 + }, + "adjust_points": { + "loyalty_program_id": "loyalty_program_id2", + "points": 96, + "reason": "reason2" + }, + "loyalty_account_id": "loyalty_account_id0", + "source": "SQUARE" +} +``` + diff --git a/legacy/doc/models/loyalty-program-accrual-rule-category-data.md b/legacy/doc/models/loyalty-program-accrual-rule-category-data.md new file mode 100644 index 000000000..887def4c2 --- /dev/null +++ b/legacy/doc/models/loyalty-program-accrual-rule-category-data.md @@ -0,0 +1,23 @@ + +# Loyalty Program Accrual Rule Category Data + +Represents additional data for rules with the `CATEGORY` accrual type. + +## Structure + +`LoyaltyProgramAccrualRuleCategoryData` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `categoryId` | `string` | Required | The ID of the `CATEGORY` [catalog object](entity:CatalogObject) that buyers can purchase to earn
points.
**Constraints**: *Minimum Length*: `1` | + +## Example (as JSON) + +```json +{ + "category_id": "category_id6" +} +``` + diff --git a/legacy/doc/models/loyalty-program-accrual-rule-item-variation-data.md b/legacy/doc/models/loyalty-program-accrual-rule-item-variation-data.md new file mode 100644 index 000000000..c4010a2ec --- /dev/null +++ b/legacy/doc/models/loyalty-program-accrual-rule-item-variation-data.md @@ -0,0 +1,23 @@ + +# Loyalty Program Accrual Rule Item Variation Data + +Represents additional data for rules with the `ITEM_VARIATION` accrual type. + +## Structure + +`LoyaltyProgramAccrualRuleItemVariationData` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `itemVariationId` | `string` | Required | The ID of the `ITEM_VARIATION` [catalog object](entity:CatalogObject) that buyers can purchase to earn
points.
**Constraints**: *Minimum Length*: `1` | + +## Example (as JSON) + +```json +{ + "item_variation_id": "item_variation_id6" +} +``` + diff --git a/legacy/doc/models/loyalty-program-accrual-rule-spend-data.md b/legacy/doc/models/loyalty-program-accrual-rule-spend-data.md new file mode 100644 index 000000000..c3308290c --- /dev/null +++ b/legacy/doc/models/loyalty-program-accrual-rule-spend-data.md @@ -0,0 +1,37 @@ + +# Loyalty Program Accrual Rule Spend Data + +Represents additional data for rules with the `SPEND` accrual type. + +## Structure + +`LoyaltyProgramAccrualRuleSpendData` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `amountMoney` | [`Money`](../../doc/models/money.md) | Required | 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. | +| `excludedCategoryIds` | `string[] \| null \| undefined` | Optional | 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. | +| `excludedItemVariationIds` | `string[] \| null \| undefined` | Optional | 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. | +| `taxMode` | [`string`](../../doc/models/loyalty-program-accrual-rule-tax-mode.md) | Required | 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. | + +## Example (as JSON) + +```json +{ + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "excluded_category_ids": [ + "excluded_category_ids4" + ], + "excluded_item_variation_ids": [ + "excluded_item_variation_ids7", + "excluded_item_variation_ids6" + ], + "tax_mode": "BEFORE_TAX" +} +``` + diff --git a/legacy/doc/models/loyalty-program-accrual-rule-tax-mode.md b/legacy/doc/models/loyalty-program-accrual-rule-tax-mode.md new file mode 100644 index 000000000..6a4d1016a --- /dev/null +++ b/legacy/doc/models/loyalty-program-accrual-rule-tax-mode.md @@ -0,0 +1,17 @@ + +# Loyalty Program Accrual Rule Tax Mode + +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. + +## Enumeration + +`LoyaltyProgramAccrualRuleTaxMode` + +## Fields + +| Name | Description | +| --- | --- | +| `BEFORE_TAX` | Exclude taxes from the purchase amount used for loyalty points accrual. | +| `AFTER_TAX` | Include taxes in the purchase amount used for loyalty points accrual. | + diff --git a/legacy/doc/models/loyalty-program-accrual-rule-type.md b/legacy/doc/models/loyalty-program-accrual-rule-type.md new file mode 100644 index 000000000..cf8384ee3 --- /dev/null +++ b/legacy/doc/models/loyalty-program-accrual-rule-type.md @@ -0,0 +1,18 @@ + +# Loyalty Program Accrual Rule Type + +The type of the accrual rule that defines how buyers can earn points. + +## Enumeration + +`LoyaltyProgramAccrualRuleType` + +## Fields + +| Name | Description | +| --- | --- | +| `VISIT` | A visit-based accrual rule. A buyer earns points for each visit.
You can specify the minimum purchase required. | +| `SPEND` | A spend-based accrual rule. A buyer earns points based on the amount
spent. | +| `ITEM_VARIATION` | An accrual rule based on an item variation. For example, accrue
points for purchasing a coffee. | +| `CATEGORY` | An accrual rule based on an item category. For example, accrue points
for purchasing any item in the "hot drink" category: coffee, tea, or hot cocoa. | + diff --git a/legacy/doc/models/loyalty-program-accrual-rule-visit-data.md b/legacy/doc/models/loyalty-program-accrual-rule-visit-data.md new file mode 100644 index 000000000..b7c7ffe71 --- /dev/null +++ b/legacy/doc/models/loyalty-program-accrual-rule-visit-data.md @@ -0,0 +1,28 @@ + +# Loyalty Program Accrual Rule Visit Data + +Represents additional data for rules with the `VISIT` accrual type. + +## Structure + +`LoyaltyProgramAccrualRuleVisitData` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `minimumAmountMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `taxMode` | [`string`](../../doc/models/loyalty-program-accrual-rule-tax-mode.md) | Required | 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. | + +## Example (as JSON) + +```json +{ + "minimum_amount_money": { + "amount": 146, + "currency": "GHS" + }, + "tax_mode": "BEFORE_TAX" +} +``` + diff --git a/legacy/doc/models/loyalty-program-accrual-rule.md b/legacy/doc/models/loyalty-program-accrual-rule.md new file mode 100644 index 000000000..691bb3e10 --- /dev/null +++ b/legacy/doc/models/loyalty-program-accrual-rule.md @@ -0,0 +1,56 @@ + +# Loyalty Program Accrual Rule + +Represents an accrual rule, which defines how buyers can earn points from the base [loyalty program](../../doc/models/loyalty-program.md). + +## Structure + +`LoyaltyProgramAccrualRule` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `accrualType` | [`string`](../../doc/models/loyalty-program-accrual-rule-type.md) | Required | The type of the accrual rule that defines how buyers can earn points. | +| `points` | `number \| null \| undefined` | Optional | The number of points that
buyers earn based on the `accrual_type`.
**Constraints**: `>= 1` | +| `visitData` | [`LoyaltyProgramAccrualRuleVisitData \| undefined`](../../doc/models/loyalty-program-accrual-rule-visit-data.md) | Optional | Represents additional data for rules with the `VISIT` accrual type. | +| `spendData` | [`LoyaltyProgramAccrualRuleSpendData \| undefined`](../../doc/models/loyalty-program-accrual-rule-spend-data.md) | Optional | Represents additional data for rules with the `SPEND` accrual type. | +| `itemVariationData` | [`LoyaltyProgramAccrualRuleItemVariationData \| undefined`](../../doc/models/loyalty-program-accrual-rule-item-variation-data.md) | Optional | Represents additional data for rules with the `ITEM_VARIATION` accrual type. | +| `categoryData` | [`LoyaltyProgramAccrualRuleCategoryData \| undefined`](../../doc/models/loyalty-program-accrual-rule-category-data.md) | Optional | Represents additional data for rules with the `CATEGORY` accrual type. | + +## Example (as JSON) + +```json +{ + "accrual_type": "VISIT", + "points": 86, + "visit_data": { + "minimum_amount_money": { + "amount": 146, + "currency": "GHS" + }, + "tax_mode": "BEFORE_TAX" + }, + "spend_data": { + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "excluded_category_ids": [ + "excluded_category_ids4" + ], + "excluded_item_variation_ids": [ + "excluded_item_variation_ids3", + "excluded_item_variation_ids4" + ], + "tax_mode": "BEFORE_TAX" + }, + "item_variation_data": { + "item_variation_id": "item_variation_id0" + }, + "category_data": { + "category_id": "category_id4" + } +} +``` + diff --git a/legacy/doc/models/loyalty-program-expiration-policy.md b/legacy/doc/models/loyalty-program-expiration-policy.md new file mode 100644 index 000000000..24f222cf4 --- /dev/null +++ b/legacy/doc/models/loyalty-program-expiration-policy.md @@ -0,0 +1,23 @@ + +# Loyalty Program Expiration Policy + +Describes when the loyalty program expires. + +## Structure + +`LoyaltyProgramExpirationPolicy` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `expirationDuration` | `string` | Required | 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.
**Constraints**: *Minimum Length*: `1` | + +## Example (as JSON) + +```json +{ + "expiration_duration": "expiration_duration2" +} +``` + diff --git a/legacy/doc/models/loyalty-program-reward-definition-scope.md b/legacy/doc/models/loyalty-program-reward-definition-scope.md new file mode 100644 index 000000000..bb3997094 --- /dev/null +++ b/legacy/doc/models/loyalty-program-reward-definition-scope.md @@ -0,0 +1,19 @@ + +# Loyalty Program Reward Definition Scope + +Indicates the scope of the reward tier. DEPRECATED at version 2020-12-16. Discount details +are now defined using a catalog pricing rule and other catalog objects. For more information, see +[Getting discount details for a reward tier](https://developer.squareup.com/docs/loyalty-api/loyalty-rewards#get-discount-details). + +## Enumeration + +`LoyaltyProgramRewardDefinitionScope` + +## Fields + +| Name | Description | +| --- | --- | +| `ORDER` | The discount applies to the entire order. | +| `ITEM_VARIATION` | The discount applies only to specific item variations. | +| `CATEGORY` | The discount applies only to items in the given categories. | + diff --git a/legacy/doc/models/loyalty-program-reward-definition-type.md b/legacy/doc/models/loyalty-program-reward-definition-type.md new file mode 100644 index 000000000..03302579d --- /dev/null +++ b/legacy/doc/models/loyalty-program-reward-definition-type.md @@ -0,0 +1,18 @@ + +# Loyalty Program Reward Definition Type + +The type of discount the reward tier offers. DEPRECATED at version 2020-12-16. Discount details +are now defined using a catalog pricing rule and other catalog objects. For more information, see +[Getting discount details for a reward tier](https://developer.squareup.com/docs/loyalty-api/loyalty-rewards#get-discount-details). + +## Enumeration + +`LoyaltyProgramRewardDefinitionType` + +## Fields + +| Name | Description | +| --- | --- | +| `FIXED_AMOUNT` | The fixed amount discounted. | +| `FIXED_PERCENTAGE` | The fixed percentage discounted. | + diff --git a/legacy/doc/models/loyalty-program-reward-definition.md b/legacy/doc/models/loyalty-program-reward-definition.md new file mode 100644 index 000000000..4542b301f --- /dev/null +++ b/legacy/doc/models/loyalty-program-reward-definition.md @@ -0,0 +1,43 @@ + +# Loyalty Program Reward Definition + +Provides details about the reward tier discount. DEPRECATED at version 2020-12-16. Discount details +are now defined using a catalog pricing rule and other catalog objects. For more information, see +[Getting discount details for a reward tier](https://developer.squareup.com/docs/loyalty-api/loyalty-rewards#get-discount-details). + +## Structure + +`LoyaltyProgramRewardDefinition` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `scope` | [`string`](../../doc/models/loyalty-program-reward-definition-scope.md) | Required | Indicates the scope of the reward tier. DEPRECATED at version 2020-12-16. Discount details
are now defined using a catalog pricing rule and other catalog objects. For more information, see
[Getting discount details for a reward tier](https://developer.squareup.com/docs/loyalty-api/loyalty-rewards#get-discount-details). | +| `discountType` | [`string`](../../doc/models/loyalty-program-reward-definition-type.md) | Required | The type of discount the reward tier offers. DEPRECATED at version 2020-12-16. Discount details
are now defined using a catalog pricing rule and other catalog objects. For more information, see
[Getting discount details for a reward tier](https://developer.squareup.com/docs/loyalty-api/loyalty-rewards#get-discount-details). | +| `percentageDiscount` | `string \| undefined` | Optional | The fixed percentage of the discount. Present if `discount_type` is `FIXED_PERCENTAGE`.
For example, a 7.25% off discount will be represented as "7.25". DEPRECATED at version 2020-12-16. You can find this
information in the `discount_data.percentage` field of the `DISCOUNT` catalog object referenced by the pricing rule. | +| `catalogObjectIds` | `string[] \| undefined` | Optional | The list of catalog objects to which this reward can be applied. They are either all item-variation ids or category ids, depending on the `type` field.
DEPRECATED at version 2020-12-16. You can find this information in the `product_set_data.product_ids_any` field
of the `PRODUCT_SET` catalog object referenced by the pricing rule. | +| `fixedDiscountMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `maxDiscountMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "scope": "ORDER", + "discount_type": "FIXED_AMOUNT", + "percentage_discount": "percentage_discount0", + "catalog_object_ids": [ + "catalog_object_ids8" + ], + "fixed_discount_money": { + "amount": 36, + "currency": "SLL" + }, + "max_discount_money": { + "amount": 84, + "currency": "BOB" + } +} +``` + diff --git a/legacy/doc/models/loyalty-program-reward-tier.md b/legacy/doc/models/loyalty-program-reward-tier.md new file mode 100644 index 000000000..6c76066c1 --- /dev/null +++ b/legacy/doc/models/loyalty-program-reward-tier.md @@ -0,0 +1,51 @@ + +# Loyalty Program Reward Tier + +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. + +## Structure + +`LoyaltyProgramRewardTier` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | The Square-assigned ID of the reward tier.
**Constraints**: *Maximum Length*: `36` | +| `points` | `number` | Required | The points exchanged for the reward tier.
**Constraints**: `>= 1` | +| `name` | `string \| undefined` | Optional | The name of the reward tier. | +| `definition` | [`LoyaltyProgramRewardDefinition \| undefined`](../../doc/models/loyalty-program-reward-definition.md) | Optional | Provides details about the reward tier discount. DEPRECATED at version 2020-12-16. Discount details
are now defined using a catalog pricing rule and other catalog objects. For more information, see
[Getting discount details for a reward tier](https://developer.squareup.com/docs/loyalty-api/loyalty-rewards#get-discount-details). | +| `createdAt` | `string \| undefined` | Optional | The timestamp when the reward tier was created, in RFC 3339 format. | +| `pricingRuleReference` | [`CatalogObjectReference`](../../doc/models/catalog-object-reference.md) | Required | 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. | + +## Example (as JSON) + +```json +{ + "id": "id2", + "points": 94, + "name": "name2", + "definition": { + "scope": "ORDER", + "discount_type": "FIXED_AMOUNT", + "percentage_discount": "percentage_discount2", + "catalog_object_ids": [ + "catalog_object_ids6" + ], + "fixed_discount_money": { + "amount": 36, + "currency": "SLL" + }, + "max_discount_money": { + "amount": 84, + "currency": "BOB" + } + }, + "created_at": "created_at0", + "pricing_rule_reference": { + "object_id": "object_id0", + "catalog_version": 218 + } +} +``` + diff --git a/legacy/doc/models/loyalty-program-status.md b/legacy/doc/models/loyalty-program-status.md new file mode 100644 index 000000000..ef1a3ed7f --- /dev/null +++ b/legacy/doc/models/loyalty-program-status.md @@ -0,0 +1,16 @@ + +# Loyalty Program Status + +Indicates whether the program is currently active. + +## Enumeration + +`LoyaltyProgramStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `INACTIVE` | The loyalty program does not have an active subscription.
Loyalty API requests fail. | +| `ACTIVE` | The program is fully functional. The program has an active subscription. | + diff --git a/legacy/doc/models/loyalty-program-terminology.md b/legacy/doc/models/loyalty-program-terminology.md new file mode 100644 index 000000000..7c7d8d0f0 --- /dev/null +++ b/legacy/doc/models/loyalty-program-terminology.md @@ -0,0 +1,25 @@ + +# Loyalty Program Terminology + +Represents the naming used for loyalty points. + +## Structure + +`LoyaltyProgramTerminology` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `one` | `string` | Required | A singular unit for a point (for example, 1 point is called 1 star).
**Constraints**: *Minimum Length*: `1` | +| `other` | `string` | Required | A plural unit for point (for example, 10 points is called 10 stars).
**Constraints**: *Minimum Length*: `1` | + +## Example (as JSON) + +```json +{ + "one": "one4", + "other": "other0" +} +``` + diff --git a/legacy/doc/models/loyalty-program.md b/legacy/doc/models/loyalty-program.md new file mode 100644 index 000000000..70d85ee82 --- /dev/null +++ b/legacy/doc/models/loyalty-program.md @@ -0,0 +1,95 @@ + +# Loyalty Program + +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). + +## Structure + +`LoyaltyProgram` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | The Square-assigned ID of the loyalty program. Updates to
the loyalty program do not modify the identifier.
**Constraints**: *Maximum Length*: `36` | +| `status` | [`string \| undefined`](../../doc/models/loyalty-program-status.md) | Optional | Indicates whether the program is currently active. | +| `rewardTiers` | [`LoyaltyProgramRewardTier[] \| null \| undefined`](../../doc/models/loyalty-program-reward-tier.md) | Optional | The list of rewards for buyers, sorted by ascending points. | +| `expirationPolicy` | [`LoyaltyProgramExpirationPolicy \| undefined`](../../doc/models/loyalty-program-expiration-policy.md) | Optional | Describes when the loyalty program expires. | +| `terminology` | [`LoyaltyProgramTerminology \| undefined`](../../doc/models/loyalty-program-terminology.md) | Optional | Represents the naming used for loyalty points. | +| `locationIds` | `string[] \| null \| undefined` | Optional | The [locations](entity:Location) at which the program is active. | +| `createdAt` | `string \| undefined` | Optional | The timestamp when the program was created, in RFC 3339 format. | +| `updatedAt` | `string \| undefined` | Optional | The timestamp when the reward was last updated, in RFC 3339 format. | +| `accrualRules` | [`LoyaltyProgramAccrualRule[] \| null \| undefined`](../../doc/models/loyalty-program-accrual-rule.md) | Optional | 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). | + +## Example (as JSON) + +```json +{ + "id": "id2", + "status": "INACTIVE", + "reward_tiers": [ + { + "id": "id8", + "points": 250, + "name": "name8", + "definition": { + "scope": "ORDER", + "discount_type": "FIXED_AMOUNT", + "percentage_discount": "percentage_discount2", + "catalog_object_ids": [ + "catalog_object_ids6" + ], + "fixed_discount_money": { + "amount": 36, + "currency": "SLL" + }, + "max_discount_money": { + "amount": 84, + "currency": "BOB" + } + }, + "created_at": "created_at6", + "pricing_rule_reference": { + "object_id": "object_id0", + "catalog_version": 218 + } + }, + { + "id": "id8", + "points": 250, + "name": "name8", + "definition": { + "scope": "ORDER", + "discount_type": "FIXED_AMOUNT", + "percentage_discount": "percentage_discount2", + "catalog_object_ids": [ + "catalog_object_ids6" + ], + "fixed_discount_money": { + "amount": 36, + "currency": "SLL" + }, + "max_discount_money": { + "amount": 84, + "currency": "BOB" + } + }, + "created_at": "created_at6", + "pricing_rule_reference": { + "object_id": "object_id0", + "catalog_version": 218 + } + } + ], + "expiration_policy": { + "expiration_duration": "expiration_duration0" + }, + "terminology": { + "one": "one0", + "other": "other6" + } +} +``` + diff --git a/legacy/doc/models/loyalty-promotion-available-time-data.md b/legacy/doc/models/loyalty-promotion-available-time-data.md new file mode 100644 index 000000000..69d690ed2 --- /dev/null +++ b/legacy/doc/models/loyalty-promotion-available-time-data.md @@ -0,0 +1,32 @@ + +# Loyalty Promotion Available Time Data + +Represents scheduling information that determines when purchases can qualify to earn points +from a [loyalty promotion](../../doc/models/loyalty-promotion.md). + +## Structure + +`LoyaltyPromotionAvailableTimeData` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `startDate` | `string \| undefined` | Optional | The date that the promotion starts, in `YYYY-MM-DD` format. Square populates this field
based on the provided `time_periods`. | +| `endDate` | `string \| undefined` | Optional | 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. | +| `timePeriods` | `string[]` | Required | 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. | + +## Example (as JSON) + +```json +{ + "start_date": "start_date4", + "end_date": "end_date0", + "time_periods": [ + "time_periods7", + "time_periods8", + "time_periods9" + ] +} +``` + diff --git a/legacy/doc/models/loyalty-promotion-incentive-points-addition-data.md b/legacy/doc/models/loyalty-promotion-incentive-points-addition-data.md new file mode 100644 index 000000000..18e5d4888 --- /dev/null +++ b/legacy/doc/models/loyalty-promotion-incentive-points-addition-data.md @@ -0,0 +1,23 @@ + +# Loyalty Promotion Incentive Points Addition Data + +Represents the metadata for a `POINTS_ADDITION` type of [loyalty promotion incentive](../../doc/models/loyalty-promotion-incentive.md). + +## Structure + +`LoyaltyPromotionIncentivePointsAdditionData` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `pointsAddition` | `number` | Required | 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).
**Constraints**: `>= 1` | + +## Example (as JSON) + +```json +{ + "points_addition": 88 +} +``` + diff --git a/legacy/doc/models/loyalty-promotion-incentive-points-multiplier-data.md b/legacy/doc/models/loyalty-promotion-incentive-points-multiplier-data.md new file mode 100644 index 000000000..ce27146d6 --- /dev/null +++ b/legacy/doc/models/loyalty-promotion-incentive-points-multiplier-data.md @@ -0,0 +1,25 @@ + +# Loyalty Promotion Incentive Points Multiplier Data + +Represents the metadata for a `POINTS_MULTIPLIER` type of [loyalty promotion incentive](../../doc/models/loyalty-promotion-incentive.md). + +## Structure + +`LoyaltyPromotionIncentivePointsMultiplierData` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `pointsMultiplier` | `number \| null \| undefined` | Optional | 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.
**Constraints**: `>= 2`, `<= 10` | +| `multiplier` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `5` | + +## Example (as JSON) + +```json +{ + "points_multiplier": 116, + "multiplier": "multiplier2" +} +``` + diff --git a/legacy/doc/models/loyalty-promotion-incentive-type.md b/legacy/doc/models/loyalty-promotion-incentive-type.md new file mode 100644 index 000000000..4797dfee0 --- /dev/null +++ b/legacy/doc/models/loyalty-promotion-incentive-type.md @@ -0,0 +1,17 @@ + +# Loyalty Promotion Incentive Type + +Indicates the type of points incentive for a [loyalty promotion](../../doc/models/loyalty-promotion.md), +which is used to determine how buyers can earn points from the promotion. + +## Enumeration + +`LoyaltyPromotionIncentiveType` + +## Fields + +| Name | Description | +| --- | --- | +| `POINTS_MULTIPLIER` | Multiply the number of points earned from the base loyalty program.
For example, "Earn double points." | +| `POINTS_ADDITION` | Add a specified number of points to those earned from the base loyalty program.
For example, "Earn 10 additional points." | + diff --git a/legacy/doc/models/loyalty-promotion-incentive.md b/legacy/doc/models/loyalty-promotion-incentive.md new file mode 100644 index 000000000..d97f1b5a2 --- /dev/null +++ b/legacy/doc/models/loyalty-promotion-incentive.md @@ -0,0 +1,34 @@ + +# Loyalty Promotion Incentive + +Represents how points for a [loyalty promotion](../../doc/models/loyalty-promotion.md) 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. + +## Structure + +`LoyaltyPromotionIncentive` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `type` | [`string`](../../doc/models/loyalty-promotion-incentive-type.md) | Required | Indicates the type of points incentive for a [loyalty promotion](../../doc/models/loyalty-promotion.md),
which is used to determine how buyers can earn points from the promotion. | +| `pointsMultiplierData` | [`LoyaltyPromotionIncentivePointsMultiplierData \| undefined`](../../doc/models/loyalty-promotion-incentive-points-multiplier-data.md) | Optional | Represents the metadata for a `POINTS_MULTIPLIER` type of [loyalty promotion incentive](../../doc/models/loyalty-promotion-incentive.md). | +| `pointsAdditionData` | [`LoyaltyPromotionIncentivePointsAdditionData \| undefined`](../../doc/models/loyalty-promotion-incentive-points-addition-data.md) | Optional | Represents the metadata for a `POINTS_ADDITION` type of [loyalty promotion incentive](../../doc/models/loyalty-promotion-incentive.md). | + +## Example (as JSON) + +```json +{ + "type": "POINTS_MULTIPLIER", + "points_multiplier_data": { + "points_multiplier": 134, + "multiplier": "multiplier4" + }, + "points_addition_data": { + "points_addition": 218 + } +} +``` + diff --git a/legacy/doc/models/loyalty-promotion-status.md b/legacy/doc/models/loyalty-promotion-status.md new file mode 100644 index 000000000..393c90c76 --- /dev/null +++ b/legacy/doc/models/loyalty-promotion-status.md @@ -0,0 +1,18 @@ + +# Loyalty Promotion Status + +Indicates the status of a [loyalty promotion](../../doc/models/loyalty-promotion.md). + +## Enumeration + +`LoyaltyPromotionStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `ACTIVE` | The loyalty promotion is currently active. Buyers can earn points for purchases
that meet the promotion conditions, such as the promotion's `available_time`. | +| `ENDED` | The loyalty promotion has ended because the specified `end_date` was reached.
`ENDED` is a terminal status. | +| `CANCELED` | The loyalty promotion was canceled. `CANCELED` is a terminal status. | +| `SCHEDULED` | The loyalty promotion is scheduled to start in the future. Square changes the
promotion status to `ACTIVE` when the `start_date` is reached. | + diff --git a/legacy/doc/models/loyalty-promotion-trigger-limit-interval.md b/legacy/doc/models/loyalty-promotion-trigger-limit-interval.md new file mode 100644 index 000000000..3be1d8130 --- /dev/null +++ b/legacy/doc/models/loyalty-promotion-trigger-limit-interval.md @@ -0,0 +1,17 @@ + +# Loyalty Promotion Trigger Limit Interval + +Indicates the time period that the [trigger limit](../../doc/models/loyalty-promotion-trigger-limit.md) applies to, +which is used to determine the number of times a buyer can earn points for a [loyalty promotion](../../doc/models/loyalty-promotion.md). + +## Enumeration + +`LoyaltyPromotionTriggerLimitInterval` + +## Fields + +| Name | Description | +| --- | --- | +| `ALL_TIME` | The limit applies to the entire time that the promotion is active. For example, if `times`
is set to 1 and `time_period` is set to `ALL_TIME`, a buyer can earn promotion points a maximum
of one time during the promotion. | +| `DAY` | The limit applies per day, according to the `available_time` schedule specified for the promotion.
For example, if the `times` field of the trigger limit is set to 1, a buyer can trigger the promotion
a maximum of once per day. | + diff --git a/legacy/doc/models/loyalty-promotion-trigger-limit.md b/legacy/doc/models/loyalty-promotion-trigger-limit.md new file mode 100644 index 000000000..44902e02c --- /dev/null +++ b/legacy/doc/models/loyalty-promotion-trigger-limit.md @@ -0,0 +1,29 @@ + +# Loyalty Promotion Trigger Limit + +Represents the number of times a buyer can earn points during a [loyalty promotion](../../doc/models/loyalty-promotion.md). +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. + +## Structure + +`LoyaltyPromotionTriggerLimit` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `times` | `number` | Required | The maximum number of times a buyer can trigger the promotion during the specified `interval`.
**Constraints**: `>= 1`, `<= 30` | +| `interval` | [`string \| undefined`](../../doc/models/loyalty-promotion-trigger-limit-interval.md) | Optional | Indicates the time period that the [trigger limit](../../doc/models/loyalty-promotion-trigger-limit.md) applies to,
which is used to determine the number of times a buyer can earn points for a [loyalty promotion](../../doc/models/loyalty-promotion.md). | + +## Example (as JSON) + +```json +{ + "times": 32, + "interval": "ALL_TIME" +} +``` + diff --git a/legacy/doc/models/loyalty-promotion.md b/legacy/doc/models/loyalty-promotion.md new file mode 100644 index 000000000..efda9267e --- /dev/null +++ b/legacy/doc/models/loyalty-promotion.md @@ -0,0 +1,63 @@ + +# Loyalty Promotion + +Represents a promotion for a [loyalty program](../../doc/models/loyalty-program.md). 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. + +## Structure + +`LoyaltyPromotion` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | The Square-assigned ID of the promotion.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | +| `name` | `string` | Required | The name of the promotion.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `70` | +| `incentive` | [`LoyaltyPromotionIncentive`](../../doc/models/loyalty-promotion-incentive.md) | Required | Represents how points for a [loyalty promotion](../../doc/models/loyalty-promotion.md) 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. | +| `availableTime` | [`LoyaltyPromotionAvailableTimeData`](../../doc/models/loyalty-promotion-available-time-data.md) | Required | Represents scheduling information that determines when purchases can qualify to earn points
from a [loyalty promotion](../../doc/models/loyalty-promotion.md). | +| `triggerLimit` | [`LoyaltyPromotionTriggerLimit \| undefined`](../../doc/models/loyalty-promotion-trigger-limit.md) | Optional | Represents the number of times a buyer can earn points during a [loyalty promotion](../../doc/models/loyalty-promotion.md).
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. | +| `status` | [`string \| undefined`](../../doc/models/loyalty-promotion-status.md) | Optional | Indicates the status of a [loyalty promotion](../../doc/models/loyalty-promotion.md). | +| `createdAt` | `string \| undefined` | Optional | The timestamp of when the promotion was created, in RFC 3339 format. | +| `canceledAt` | `string \| undefined` | Optional | The timestamp of when the promotion was canceled, in RFC 3339 format. | +| `updatedAt` | `string \| undefined` | Optional | The timestamp when the promotion was last updated, in RFC 3339 format. | +| `loyaltyProgramId` | `string \| undefined` | Optional | The ID of the [loyalty program](entity:LoyaltyProgram) associated with the promotion. | +| `minimumSpendAmountMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `qualifyingItemVariationIds` | `string[] \| null \| undefined` | Optional | 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. | +| `qualifyingCategoryIds` | `string[] \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "id": "id4", + "name": "name4", + "incentive": { + "type": "POINTS_MULTIPLIER", + "points_multiplier_data": { + "points_multiplier": 134, + "multiplier": "multiplier4" + }, + "points_addition_data": { + "points_addition": 218 + } + }, + "available_time": { + "start_date": "start_date4", + "end_date": "end_date8", + "time_periods": [ + "time_periods9" + ] + }, + "trigger_limit": { + "times": 26, + "interval": "ALL_TIME" + }, + "status": "ACTIVE", + "created_at": "created_at8", + "canceled_at": "canceled_at0" +} +``` + diff --git a/legacy/doc/models/loyalty-reward-status.md b/legacy/doc/models/loyalty-reward-status.md new file mode 100644 index 000000000..26be27d31 --- /dev/null +++ b/legacy/doc/models/loyalty-reward-status.md @@ -0,0 +1,17 @@ + +# Loyalty Reward Status + +The status of the loyalty reward. + +## Enumeration + +`LoyaltyRewardStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `ISSUED` | The reward is issued. | +| `REDEEMED` | The reward is redeemed. | +| `DELETED` | The reward is deleted. | + diff --git a/legacy/doc/models/loyalty-reward.md b/legacy/doc/models/loyalty-reward.md new file mode 100644 index 000000000..f5aa89c36 --- /dev/null +++ b/legacy/doc/models/loyalty-reward.md @@ -0,0 +1,38 @@ + +# Loyalty Reward + +Represents a contract to redeem loyalty points for a [reward tier](../../doc/models/loyalty-program-reward-tier.md) 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). + +## Structure + +`LoyaltyReward` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | The Square-assigned ID of the loyalty reward.
**Constraints**: *Maximum Length*: `36` | +| `status` | [`string \| undefined`](../../doc/models/loyalty-reward-status.md) | Optional | The status of the loyalty reward. | +| `loyaltyAccountId` | `string` | Required | The Square-assigned ID of the [loyalty account](entity:LoyaltyAccount) to which the reward belongs.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | +| `rewardTierId` | `string` | Required | The Square-assigned ID of the [reward tier](entity:LoyaltyProgramRewardTier) used to create the reward.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | +| `points` | `number \| undefined` | Optional | The number of loyalty points used for the reward.
**Constraints**: `>= 1` | +| `orderId` | `string \| null \| undefined` | Optional | The Square-assigned ID of the [order](entity:Order) to which the reward is attached. | +| `createdAt` | `string \| undefined` | Optional | The timestamp when the reward was created, in RFC 3339 format. | +| `updatedAt` | `string \| undefined` | Optional | The timestamp when the reward was last updated, in RFC 3339 format. | +| `redeemedAt` | `string \| undefined` | Optional | The timestamp when the reward was redeemed, in RFC 3339 format. | + +## Example (as JSON) + +```json +{ + "id": "id6", + "status": "DELETED", + "loyalty_account_id": "loyalty_account_id4", + "reward_tier_id": "reward_tier_id2", + "points": 114, + "order_id": "order_id0", + "created_at": "created_at4" +} +``` + diff --git a/legacy/doc/models/measurement-unit-area.md b/legacy/doc/models/measurement-unit-area.md new file mode 100644 index 000000000..c11489141 --- /dev/null +++ b/legacy/doc/models/measurement-unit-area.md @@ -0,0 +1,22 @@ + +# Measurement Unit Area + +Unit of area used to measure a quantity. + +## Enumeration + +`MeasurementUnitArea` + +## Fields + +| Name | Description | +| --- | --- | +| `IMPERIAL_ACRE` | The area is measured in acres. | +| `IMPERIAL_SQUARE_INCH` | The area is measured in square inches. | +| `IMPERIAL_SQUARE_FOOT` | The area is measured in square feet. | +| `IMPERIAL_SQUARE_YARD` | The area is measured in square yards. | +| `IMPERIAL_SQUARE_MILE` | The area is measured in square miles. | +| `METRIC_SQUARE_CENTIMETER` | The area is measured in square centimeters. | +| `METRIC_SQUARE_METER` | The area is measured in square meters. | +| `METRIC_SQUARE_KILOMETER` | The area is measured in square kilometers. | + diff --git a/legacy/doc/models/measurement-unit-custom.md b/legacy/doc/models/measurement-unit-custom.md new file mode 100644 index 000000000..736170e51 --- /dev/null +++ b/legacy/doc/models/measurement-unit-custom.md @@ -0,0 +1,25 @@ + +# Measurement Unit Custom + +The information needed to define a custom unit, provided by the seller. + +## Structure + +`MeasurementUnitCustom` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `string` | Required | The name of the custom unit, for example "bushel". | +| `abbreviation` | `string` | Required | The abbreviation of the custom unit, such as "bsh" (bushel). This appears
in the cart for the Point of Sale app, and in reports. | + +## Example (as JSON) + +```json +{ + "name": "name8", + "abbreviation": "abbreviation0" +} +``` + diff --git a/legacy/doc/models/measurement-unit-generic.md b/legacy/doc/models/measurement-unit-generic.md new file mode 100644 index 000000000..0206fe95f --- /dev/null +++ b/legacy/doc/models/measurement-unit-generic.md @@ -0,0 +1,13 @@ + +# Measurement Unit Generic + +## Enumeration + +`MeasurementUnitGeneric` + +## Fields + +| Name | Description | +| --- | --- | +| `UNIT` | The generic unit. | + diff --git a/legacy/doc/models/measurement-unit-length.md b/legacy/doc/models/measurement-unit-length.md new file mode 100644 index 000000000..82dfc078f --- /dev/null +++ b/legacy/doc/models/measurement-unit-length.md @@ -0,0 +1,22 @@ + +# Measurement Unit Length + +The unit of length used to measure a quantity. + +## Enumeration + +`MeasurementUnitLength` + +## Fields + +| Name | Description | +| --- | --- | +| `IMPERIAL_INCH` | The length is measured in inches. | +| `IMPERIAL_FOOT` | The length is measured in feet. | +| `IMPERIAL_YARD` | The length is measured in yards. | +| `IMPERIAL_MILE` | The length is measured in miles. | +| `METRIC_MILLIMETER` | The length is measured in millimeters. | +| `METRIC_CENTIMETER` | The length is measured in centimeters. | +| `METRIC_METER` | The length is measured in meters. | +| `METRIC_KILOMETER` | The length is measured in kilometers. | + diff --git a/legacy/doc/models/measurement-unit-time.md b/legacy/doc/models/measurement-unit-time.md new file mode 100644 index 000000000..43b8c4ce9 --- /dev/null +++ b/legacy/doc/models/measurement-unit-time.md @@ -0,0 +1,19 @@ + +# Measurement Unit Time + +Unit of time used to measure a quantity (a duration). + +## Enumeration + +`MeasurementUnitTime` + +## Fields + +| Name | Description | +| --- | --- | +| `GENERIC_MILLISECOND` | The time is measured in milliseconds. | +| `GENERIC_SECOND` | The time is measured in seconds. | +| `GENERIC_MINUTE` | The time is measured in minutes. | +| `GENERIC_HOUR` | The time is measured in hours. | +| `GENERIC_DAY` | The time is measured in days. | + diff --git a/legacy/doc/models/measurement-unit-unit-type.md b/legacy/doc/models/measurement-unit-unit-type.md new file mode 100644 index 000000000..bcf03f399 --- /dev/null +++ b/legacy/doc/models/measurement-unit-unit-type.md @@ -0,0 +1,20 @@ + +# Measurement Unit Unit Type + +Describes the type of this unit and indicates which field contains the unit information. This is an ‘open’ enum. + +## Enumeration + +`MeasurementUnitUnitType` + +## Fields + +| Name | Description | +| --- | --- | +| `TYPE_CUSTOM` | The unit details are contained in the custom_unit field. | +| `TYPE_AREA` | The unit details are contained in the area_unit field. | +| `TYPE_LENGTH` | The unit details are contained in the length_unit field. | +| `TYPE_VOLUME` | The unit details are contained in the volume_unit field. | +| `TYPE_WEIGHT` | The unit details are contained in the weight_unit field. | +| `TYPE_GENERIC` | The unit details are contained in the generic_unit field. | + diff --git a/legacy/doc/models/measurement-unit-volume.md b/legacy/doc/models/measurement-unit-volume.md new file mode 100644 index 000000000..822a52168 --- /dev/null +++ b/legacy/doc/models/measurement-unit-volume.md @@ -0,0 +1,25 @@ + +# Measurement Unit Volume + +The unit of volume used to measure a quantity. + +## Enumeration + +`MeasurementUnitVolume` + +## Fields + +| Name | Description | +| --- | --- | +| `GENERIC_FLUID_OUNCE` | The volume is measured in ounces. | +| `GENERIC_SHOT` | The volume is measured in shots. | +| `GENERIC_CUP` | The volume is measured in cups. | +| `GENERIC_PINT` | The volume is measured in pints. | +| `GENERIC_QUART` | The volume is measured in quarts. | +| `GENERIC_GALLON` | The volume is measured in gallons. | +| `IMPERIAL_CUBIC_INCH` | The volume is measured in cubic inches. | +| `IMPERIAL_CUBIC_FOOT` | The volume is measured in cubic feet. | +| `IMPERIAL_CUBIC_YARD` | The volume is measured in cubic yards. | +| `METRIC_MILLILITER` | The volume is measured in metric milliliters. | +| `METRIC_LITER` | The volume is measured in metric liters. | + diff --git a/legacy/doc/models/measurement-unit-weight.md b/legacy/doc/models/measurement-unit-weight.md new file mode 100644 index 000000000..1b81d26e3 --- /dev/null +++ b/legacy/doc/models/measurement-unit-weight.md @@ -0,0 +1,20 @@ + +# Measurement Unit Weight + +Unit of weight used to measure a quantity. + +## Enumeration + +`MeasurementUnitWeight` + +## Fields + +| Name | Description | +| --- | --- | +| `IMPERIAL_WEIGHT_OUNCE` | The weight is measured in ounces. | +| `IMPERIAL_POUND` | The weight is measured in pounds. | +| `IMPERIAL_STONE` | The weight is measured in stones. | +| `METRIC_MILLIGRAM` | The weight is measured in milligrams. | +| `METRIC_GRAM` | The weight is measured in grams. | +| `METRIC_KILOGRAM` | The weight is measured in kilograms. | + diff --git a/legacy/doc/models/measurement-unit.md b/legacy/doc/models/measurement-unit.md new file mode 100644 index 000000000..e529d41ce --- /dev/null +++ b/legacy/doc/models/measurement-unit.md @@ -0,0 +1,39 @@ + +# Measurement Unit + +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`. + +## Structure + +`MeasurementUnit` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customUnit` | [`MeasurementUnitCustom \| undefined`](../../doc/models/measurement-unit-custom.md) | Optional | The information needed to define a custom unit, provided by the seller. | +| `areaUnit` | [`string \| undefined`](../../doc/models/measurement-unit-area.md) | Optional | Unit of area used to measure a quantity. | +| `lengthUnit` | [`string \| undefined`](../../doc/models/measurement-unit-length.md) | Optional | The unit of length used to measure a quantity. | +| `volumeUnit` | [`string \| undefined`](../../doc/models/measurement-unit-volume.md) | Optional | The unit of volume used to measure a quantity. | +| `weightUnit` | [`string \| undefined`](../../doc/models/measurement-unit-weight.md) | Optional | Unit of weight used to measure a quantity. | +| `genericUnit` | [`string \| undefined`](../../doc/models/measurement-unit-generic.md) | Optional | - | +| `timeUnit` | [`string \| undefined`](../../doc/models/measurement-unit-time.md) | Optional | Unit of time used to measure a quantity (a duration). | +| `type` | [`string \| undefined`](../../doc/models/measurement-unit-unit-type.md) | Optional | Describes the type of this unit and indicates which field contains the unit information. This is an ‘open’ enum. | + +## Example (as JSON) + +```json +{ + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_SQUARE_MILE", + "length_unit": "METRIC_MILLIMETER", + "volume_unit": "IMPERIAL_CUBIC_INCH", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" +} +``` + diff --git a/legacy/doc/models/merchant-status.md b/legacy/doc/models/merchant-status.md new file mode 100644 index 000000000..9e3e199d1 --- /dev/null +++ b/legacy/doc/models/merchant-status.md @@ -0,0 +1,14 @@ + +# Merchant Status + +## Enumeration + +`MerchantStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `ACTIVE` | A fully operational merchant account. The merchant can interact with Square products and APIs. | +| `INACTIVE` | A functionally limited merchant account. The merchant can only have limited interaction
via Square APIs. The merchant cannot log in or access the seller dashboard. | + diff --git a/legacy/doc/models/merchant.md b/legacy/doc/models/merchant.md new file mode 100644 index 000000000..b13f6f8d5 --- /dev/null +++ b/legacy/doc/models/merchant.md @@ -0,0 +1,35 @@ + +# Merchant + +Represents a business that sells with Square. + +## Structure + +`Merchant` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | The Square-issued ID of the merchant. | +| `businessName` | `string \| null \| undefined` | Optional | The name of the merchant's overall business. | +| `country` | [`string`](../../doc/models/country.md) | Required | 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). | +| `languageCode` | `string \| null \| undefined` | Optional | 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` | [`string \| undefined`](../../doc/models/currency.md) | Optional | Indicates the associated currency for an amount of money. Values correspond
to [ISO 4217](https://wikipedia.org/wiki/ISO_4217). | +| `status` | [`string \| undefined`](../../doc/models/merchant-status.md) | Optional | - | +| `mainLocationId` | `string \| null \| undefined` | Optional | The ID of the [main `Location`](https://developer.squareup.com/docs/locations-api#about-the-main-location) for this merchant. | +| `createdAt` | `string \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "id": "id2", + "business_name": "business_name6", + "country": "HM", + "language_code": "language_code0", + "currency": "BTC", + "status": "ACTIVE" +} +``` + diff --git a/legacy/doc/models/modifier-location-overrides.md b/legacy/doc/models/modifier-location-overrides.md new file mode 100644 index 000000000..f60099834 --- /dev/null +++ b/legacy/doc/models/modifier-location-overrides.md @@ -0,0 +1,30 @@ + +# Modifier Location Overrides + +Location-specific overrides for specified properties of a `CatalogModifier` object. + +## Structure + +`ModifierLocationOverrides` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string \| null \| undefined` | Optional | The ID of the `Location` object representing the location. This can include a deactivated location. | +| `priceMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `soldOut` | `boolean \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "location_id": "location_id2", + "price_money": { + "amount": 202, + "currency": "GTQ" + }, + "sold_out": false +} +``` + diff --git a/legacy/doc/models/money.md b/legacy/doc/models/money.md new file mode 100644 index 000000000..be5e68336 --- /dev/null +++ b/legacy/doc/models/money.md @@ -0,0 +1,30 @@ + +# Money + +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. + +## Structure + +`Money` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `amount` | `bigint \| null \| undefined` | Optional | 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` | [`string \| undefined`](../../doc/models/currency.md) | Optional | Indicates the associated currency for an amount of money. Values correspond
to [ISO 4217](https://wikipedia.org/wiki/ISO_4217). | + +## Example (as JSON) + +```json +{ + "amount": 36, + "currency": "AZN" +} +``` + diff --git a/legacy/doc/models/obtain-token-request.md b/legacy/doc/models/obtain-token-request.md new file mode 100644 index 000000000..3e16ab9d1 --- /dev/null +++ b/legacy/doc/models/obtain-token-request.md @@ -0,0 +1,36 @@ + +# Obtain Token Request + +## Structure + +`ObtainTokenRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `clientId` | `string` | Required | The Square-issued ID of your application, which is available on the **OAuth** page in the
[Developer Dashboard](https://developer.squareup.com/apps).
**Constraints**: *Maximum Length*: `191` | +| `clientSecret` | `string \| null \| undefined` | Optional | The Square-issued application secret for your application, which is available on the **OAuth** page
in the [Developer Dashboard](https://developer.squareup.com/apps). This parameter is only required when
you're not using the [OAuth PKCE (Proof Key for Code Exchange) flow](https://developer.squareup.com/docs/oauth-api/overview#pkce-flow).
The PKCE flow requires a `code_verifier` instead of a `client_secret` when `grant_type` is set to `authorization_code`.
If `grant_type` is set to `refresh_token` and the `refresh_token` is obtained uaing PKCE, the PKCE flow only requires `client_id`, 
`grant_type`, and `refresh_token`.
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `1024` | +| `code` | `string \| null \| undefined` | Optional | The authorization code to exchange.
This code is required if `grant_type` is set to `authorization_code` to indicate that
the application wants to exchange an authorization code for an OAuth access token.
**Constraints**: *Maximum Length*: `191` | +| `redirectUri` | `string \| null \| undefined` | Optional | The redirect URL assigned on the **OAuth** page for your application in the [Developer Dashboard](https://developer.squareup.com/apps).
**Constraints**: *Maximum Length*: `2048` | +| `grantType` | `string` | Required | Specifies the method to request an OAuth access token.
Valid values are `authorization_code`, `refresh_token`, and `migration_token`.
**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `20` | +| `refreshToken` | `string \| null \| undefined` | Optional | A valid refresh token for generating a new OAuth access token.

A valid refresh token is required if `grant_type` is set to `refresh_token`
to indicate that the application wants a replacement for an expired OAuth access token.
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `1024` | +| `migrationToken` | `string \| null \| undefined` | Optional | A legacy OAuth access token obtained using a Connect API version prior
to 2019-03-13. This parameter is required if `grant_type` is set to
`migration_token` to indicate that the application wants to get a replacement
OAuth access token. The response also returns a refresh token.
For more information, see [Migrate to Using Refresh Tokens](https://developer.squareup.com/docs/oauth-api/migrate-to-refresh-tokens).
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `1024` | +| `scopes` | `string[] \| null \| undefined` | Optional | A JSON list of strings representing the permissions that the application is requesting.
For example, "`["MERCHANT_PROFILE_READ","PAYMENTS_READ","BANK_ACCOUNTS_READ"]`".

The access token returned in the response is granted the permissions
that comprise the intersection between the requested list of permissions and those
that belong to the provided refresh token. | +| `shortLived` | `boolean \| null \| undefined` | Optional | A Boolean indicating a request for a short-lived access token.

The short-lived access token returned in the response expires in 24 hours. | +| `codeVerifier` | `string \| null \| undefined` | Optional | Must be provided when using the PKCE OAuth flow if `grant_type` is set to `authorization_code`. The `code_verifier` is used to verify against the
`code_challenge` associated with the `authorization_code`. | + +## Example (as JSON) + +```json +{ + "client_id": "APPLICATION_ID", + "client_secret": "APPLICATION_SECRET", + "code": "CODE_FROM_AUTHORIZE", + "grant_type": "authorization_code", + "redirect_uri": "redirect_uri6", + "refresh_token": "refresh_token8", + "migration_token": "migration_token6" +} +``` + diff --git a/legacy/doc/models/obtain-token-response.md b/legacy/doc/models/obtain-token-response.md new file mode 100644 index 000000000..2864ff206 --- /dev/null +++ b/legacy/doc/models/obtain-token-response.md @@ -0,0 +1,36 @@ + +# Obtain Token Response + +## Structure + +`ObtainTokenResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `accessToken` | `string \| undefined` | Optional | A valid OAuth access token.
Provide the access token in a header with every request to Connect API
endpoints. For more information, see [OAuth API: Walkthrough](https://developer.squareup.com/docs/oauth-api/walkthrough).
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `1024` | +| `tokenType` | `string \| undefined` | Optional | This value is always _bearer_.
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `10` | +| `expiresAt` | `string \| undefined` | Optional | The date when the `access_token` expires, in [ISO 8601](http://www.iso.org/iso/home/standards/iso8601.htm) format.
**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `48` | +| `merchantId` | `string \| undefined` | Optional | The ID of the authorizing merchant's business.
**Constraints**: *Minimum Length*: `8`, *Maximum Length*: `191` | +| `subscriptionId` | `string \| undefined` | Optional | __LEGACY FIELD__. The ID of a subscription plan the merchant signed up
for. The ID is only present if the merchant signed up for a subscription plan during authorization. | +| `planId` | `string \| undefined` | Optional | __LEGACY FIELD__. 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. | +| `idToken` | `string \| undefined` | Optional | The OpenID token belonging to this person. This token is only present if the
OPENID scope is included in the authorization request. | +| `refreshToken` | `string \| undefined` | Optional | A refresh token.
For more information, see [Refresh, Revoke, and Limit the Scope of OAuth Tokens](https://developer.squareup.com/docs/oauth-api/refresh-revoke-limit-scope).
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `1024` | +| `shortLived` | `boolean \| undefined` | Optional | A Boolean indicating that the access token is a short-lived access token.
The short-lived access token returned in the response expires in 24 hours. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `refreshTokenExpiresAt` | `string \| undefined` | Optional | The date when the `refresh_token` expires, in [ISO 8601](http://www.iso.org/iso/home/standards/iso8601.htm) format.
**Constraints**: *Minimum Length*: `20`, *Maximum Length*: `48` | + +## Example (as JSON) + +```json +{ + "access_token": "ACCESS_TOKEN", + "expires_at": "2006-01-02T15:04:05Z", + "merchant_id": "MERCHANT_ID", + "refresh_token": "REFRESH_TOKEN", + "token_type": "bearer", + "subscription_id": "subscription_id8" +} +``` + diff --git a/legacy/doc/models/offline-payment-details.md b/legacy/doc/models/offline-payment-details.md new file mode 100644 index 000000000..962a5bac6 --- /dev/null +++ b/legacy/doc/models/offline-payment-details.md @@ -0,0 +1,23 @@ + +# Offline Payment Details + +Details specific to offline payments. + +## Structure + +`OfflinePaymentDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `clientCreatedAt` | `string \| undefined` | Optional | The client-side timestamp of when the offline payment was created, in RFC 3339 format.
**Constraints**: *Maximum Length*: `32` | + +## Example (as JSON) + +```json +{ + "client_created_at": "client_created_at6" +} +``` + diff --git a/legacy/doc/models/order-created-object.md b/legacy/doc/models/order-created-object.md new file mode 100644 index 000000000..54dabf253 --- /dev/null +++ b/legacy/doc/models/order-created-object.md @@ -0,0 +1,27 @@ + +# Order Created Object + +## Structure + +`OrderCreatedObject` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `orderCreated` | [`OrderCreated \| undefined`](../../doc/models/order-created.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "order_created": { + "order_id": "order_id8", + "version": 170, + "location_id": "location_id8", + "state": "CANCELED", + "created_at": "created_at2" + } +} +``` + diff --git a/legacy/doc/models/order-created.md b/legacy/doc/models/order-created.md new file mode 100644 index 000000000..93c2388d2 --- /dev/null +++ b/legacy/doc/models/order-created.md @@ -0,0 +1,29 @@ + +# Order Created + +## Structure + +`OrderCreated` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `orderId` | `string \| null \| undefined` | Optional | The order's unique ID. | +| `version` | `number \| undefined` | Optional | 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) | +| `locationId` | `string \| null \| undefined` | Optional | The ID of the seller location that this order is associated with. | +| `state` | [`string \| undefined`](../../doc/models/order-state.md) | Optional | The state of the order. | +| `createdAt` | `string \| undefined` | Optional | The timestamp for when the order was created, in RFC 3339 format. | + +## Example (as JSON) + +```json +{ + "order_id": "order_id8", + "version": 86, + "location_id": "location_id8", + "state": "CANCELED", + "created_at": "created_at2" +} +``` + diff --git a/legacy/doc/models/order-entry.md b/legacy/doc/models/order-entry.md new file mode 100644 index 000000000..985cf2e31 --- /dev/null +++ b/legacy/doc/models/order-entry.md @@ -0,0 +1,28 @@ + +# Order Entry + +A lightweight description of an [order](../../doc/models/order.md) that is returned when +`returned_entries` is `true` on a [SearchOrdersRequest](../../doc/api/orders.md#search-orders). + +## Structure + +`OrderEntry` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `orderId` | `string \| null \| undefined` | Optional | The ID of the order. | +| `version` | `number \| undefined` | Optional | 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) | +| `locationId` | `string \| null \| undefined` | Optional | The location ID the order belongs to. | + +## Example (as JSON) + +```json +{ + "order_id": "order_id0", + "version": 72, + "location_id": "location_id0" +} +``` + diff --git a/legacy/doc/models/order-fulfillment-delivery-details-schedule-type.md b/legacy/doc/models/order-fulfillment-delivery-details-schedule-type.md new file mode 100644 index 000000000..31e92720a --- /dev/null +++ b/legacy/doc/models/order-fulfillment-delivery-details-schedule-type.md @@ -0,0 +1,16 @@ + +# Order Fulfillment Delivery Details Schedule Type + +The schedule type of the delivery fulfillment. + +## Enumeration + +`OrderFulfillmentDeliveryDetailsScheduleType` + +## Fields + +| Name | Description | +| --- | --- | +| `SCHEDULED` | Indicates the fulfillment to deliver at a scheduled deliver time. | +| `ASAP` | Indicates that the fulfillment to deliver as soon as possible and should be prepared
immediately. | + diff --git a/legacy/doc/models/order-fulfillment-delivery-details.md b/legacy/doc/models/order-fulfillment-delivery-details.md new file mode 100644 index 000000000..c490c58cd --- /dev/null +++ b/legacy/doc/models/order-fulfillment-delivery-details.md @@ -0,0 +1,61 @@ + +# Order Fulfillment Delivery Details + +Describes delivery details of an order fulfillment. + +## Structure + +`OrderFulfillmentDeliveryDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `recipient` | [`OrderFulfillmentRecipient \| undefined`](../../doc/models/order-fulfillment-recipient.md) | Optional | Information about the fulfillment recipient. | +| `scheduleType` | [`string \| undefined`](../../doc/models/order-fulfillment-delivery-details-schedule-type.md) | Optional | The schedule type of the delivery fulfillment. | +| `placedAt` | `string \| undefined` | Optional | 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". | +| `deliverAt` | `string \| null \| undefined` | Optional | 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"). | +| `prepTimeDuration` | `string \| null \| undefined` | Optional | The duration of time it takes to prepare and deliver this fulfillment.
The duration must be in RFC 3339 format (for example, "P1W3D"). | +| `deliveryWindowDuration` | `string \| null \| undefined` | Optional | 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` | `string \| null \| undefined` | Optional | Provides additional instructions about the delivery fulfillment.
It is displayed in the Square Point of Sale application and set by the API.
**Constraints**: *Maximum Length*: `550` | +| `completedAt` | `string \| null \| undefined` | Optional | 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"). | +| `inProgressAt` | `string \| undefined` | Optional | 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"). | +| `rejectedAt` | `string \| undefined` | Optional | 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"). | +| `readyAt` | `string \| undefined` | Optional | 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"). | +| `deliveredAt` | `string \| undefined` | Optional | 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"). | +| `canceledAt` | `string \| undefined` | Optional | 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"). | +| `cancelReason` | `string \| null \| undefined` | Optional | The delivery cancellation reason. Max length: 100 characters.
**Constraints**: *Maximum Length*: `100` | +| `courierPickupAt` | `string \| null \| undefined` | Optional | 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"). | +| `courierPickupWindowDuration` | `string \| null \| undefined` | Optional | 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"). | +| `isNoContactDelivery` | `boolean \| null \| undefined` | Optional | Whether the delivery is preferred to be no contact. | +| `dropoffNotes` | `string \| null \| undefined` | Optional | A note to provide additional instructions about how to deliver the order.
**Constraints**: *Maximum Length*: `550` | +| `courierProviderName` | `string \| null \| undefined` | Optional | The name of the courier provider.
**Constraints**: *Maximum Length*: `255` | +| `courierSupportPhoneNumber` | `string \| null \| undefined` | Optional | The support phone number of the courier.
**Constraints**: *Maximum Length*: `17` | +| `squareDeliveryId` | `string \| null \| undefined` | Optional | The identifier for the delivery created by Square.
**Constraints**: *Maximum Length*: `50` | +| `externalDeliveryId` | `string \| null \| undefined` | Optional | The identifier for the delivery created by the third-party courier service.
**Constraints**: *Maximum Length*: `50` | +| `managedDelivery` | `boolean \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "recipient": { + "customer_id": "customer_id6", + "display_name": "display_name8", + "email_address": "email_address4", + "phone_number": "phone_number4", + "address": { + "address_line_1": "address_line_16", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "locality": "locality6", + "sublocality": "sublocality6" + } + }, + "schedule_type": "SCHEDULED", + "placed_at": "placed_at6", + "deliver_at": "deliver_at2", + "prep_time_duration": "prep_time_duration6" +} +``` + diff --git a/legacy/doc/models/order-fulfillment-fulfillment-entry.md b/legacy/doc/models/order-fulfillment-fulfillment-entry.md new file mode 100644 index 000000000..0a9672821 --- /dev/null +++ b/legacy/doc/models/order-fulfillment-fulfillment-entry.md @@ -0,0 +1,35 @@ + +# Order Fulfillment Fulfillment Entry + +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. + +## Structure + +`OrderFulfillmentFulfillmentEntry` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string \| null \| undefined` | Optional | A unique ID that identifies the fulfillment entry only within this order.
**Constraints**: *Maximum Length*: `60` | +| `lineItemUid` | `string` | Required | The `uid` from the order line item.
**Constraints**: *Minimum Length*: `1` | +| `quantity` | `string` | Required | 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"`.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `12` | +| `metadata` | `Record \| null \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "uid": "uid6", + "line_item_uid": "line_item_uid6", + "quantity": "quantity2", + "metadata": { + "key0": "metadata7", + "key1": "metadata8", + "key2": "metadata9" + } +} +``` + diff --git a/legacy/doc/models/order-fulfillment-fulfillment-line-item-application.md b/legacy/doc/models/order-fulfillment-fulfillment-line-item-application.md new file mode 100644 index 000000000..41268cb5c --- /dev/null +++ b/legacy/doc/models/order-fulfillment-fulfillment-line-item-application.md @@ -0,0 +1,17 @@ + +# Order Fulfillment Fulfillment Line Item Application + +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. + +## Enumeration + +`OrderFulfillmentFulfillmentLineItemApplication` + +## Fields + +| Name | Description | +| --- | --- | +| `ALL` | If `ALL`, `entries` must be unset. | +| `ENTRY_LIST` | If `ENTRY_LIST`, supply a list of `entries`. | + diff --git a/legacy/doc/models/order-fulfillment-pickup-details-curbside-pickup-details.md b/legacy/doc/models/order-fulfillment-pickup-details-curbside-pickup-details.md new file mode 100644 index 000000000..c85e09d79 --- /dev/null +++ b/legacy/doc/models/order-fulfillment-pickup-details-curbside-pickup-details.md @@ -0,0 +1,25 @@ + +# Order Fulfillment Pickup Details Curbside Pickup Details + +Specific details for curbside pickup. + +## Structure + +`OrderFulfillmentPickupDetailsCurbsidePickupDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `curbsideDetails` | `string \| null \| undefined` | Optional | Specific details for curbside pickup, such as parking number and vehicle model.
**Constraints**: *Maximum Length*: `250` | +| `buyerArrivedAt` | `string \| null \| undefined` | Optional | 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"). | + +## Example (as JSON) + +```json +{ + "curbside_details": "curbside_details8", + "buyer_arrived_at": "buyer_arrived_at4" +} +``` + diff --git a/legacy/doc/models/order-fulfillment-pickup-details-schedule-type.md b/legacy/doc/models/order-fulfillment-pickup-details-schedule-type.md new file mode 100644 index 000000000..6e774d4ab --- /dev/null +++ b/legacy/doc/models/order-fulfillment-pickup-details-schedule-type.md @@ -0,0 +1,16 @@ + +# Order Fulfillment Pickup Details Schedule Type + +The schedule type of the pickup fulfillment. + +## Enumeration + +`OrderFulfillmentPickupDetailsScheduleType` + +## Fields + +| Name | Description | +| --- | --- | +| `SCHEDULED` | Indicates that the fulfillment will be picked up at a scheduled pickup time. | +| `ASAP` | Indicates that the fulfillment will be picked up as soon as possible and
should be prepared immediately. | + diff --git a/legacy/doc/models/order-fulfillment-pickup-details.md b/legacy/doc/models/order-fulfillment-pickup-details.md new file mode 100644 index 000000000..004b92583 --- /dev/null +++ b/legacy/doc/models/order-fulfillment-pickup-details.md @@ -0,0 +1,56 @@ + +# Order Fulfillment Pickup Details + +Contains details necessary to fulfill a pickup order. + +## Structure + +`OrderFulfillmentPickupDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `recipient` | [`OrderFulfillmentRecipient \| undefined`](../../doc/models/order-fulfillment-recipient.md) | Optional | Information about the fulfillment recipient. | +| `expiresAt` | `string \| null \| undefined` | Optional | 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. | +| `autoCompleteDuration` | `string \| null \| undefined` | Optional | 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. | +| `scheduleType` | [`string \| undefined`](../../doc/models/order-fulfillment-pickup-details-schedule-type.md) | Optional | The schedule type of the pickup fulfillment. | +| `pickupAt` | `string \| null \| undefined` | Optional | 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. | +| `pickupWindowDuration` | `string \| null \| undefined` | Optional | 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. | +| `prepTimeDuration` | `string \| null \| undefined` | Optional | The duration of time it takes to prepare this fulfillment.
The duration must be in RFC 3339 format (for example, "P1W3D"). | +| `note` | `string \| null \| undefined` | Optional | A note to provide additional instructions about the pickup
fulfillment displayed in the Square Point of Sale application and set by the API.
**Constraints**: *Maximum Length*: `500` | +| `placedAt` | `string \| undefined` | Optional | 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"). | +| `acceptedAt` | `string \| undefined` | Optional | 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"). | +| `rejectedAt` | `string \| undefined` | Optional | 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"). | +| `readyAt` | `string \| undefined` | Optional | 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"). | +| `expiredAt` | `string \| undefined` | Optional | 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"). | +| `pickedUpAt` | `string \| undefined` | Optional | 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"). | +| `canceledAt` | `string \| undefined` | Optional | 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"). | +| `cancelReason` | `string \| null \| undefined` | Optional | A description of why the pickup was canceled. The maximum length: 100 characters.
**Constraints**: *Maximum Length*: `100` | +| `isCurbsidePickup` | `boolean \| null \| undefined` | Optional | If set to `true`, indicates that this pickup order is for curbside pickup, not in-store pickup. | +| `curbsidePickupDetails` | [`OrderFulfillmentPickupDetailsCurbsidePickupDetails \| undefined`](../../doc/models/order-fulfillment-pickup-details-curbside-pickup-details.md) | Optional | Specific details for curbside pickup. | + +## Example (as JSON) + +```json +{ + "recipient": { + "customer_id": "customer_id6", + "display_name": "display_name8", + "email_address": "email_address4", + "phone_number": "phone_number4", + "address": { + "address_line_1": "address_line_16", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "locality": "locality6", + "sublocality": "sublocality6" + } + }, + "expires_at": "expires_at0", + "auto_complete_duration": "auto_complete_duration0", + "schedule_type": "SCHEDULED", + "pickup_at": "pickup_at8" +} +``` + diff --git a/legacy/doc/models/order-fulfillment-recipient.md b/legacy/doc/models/order-fulfillment-recipient.md new file mode 100644 index 000000000..217e1184e --- /dev/null +++ b/legacy/doc/models/order-fulfillment-recipient.md @@ -0,0 +1,37 @@ + +# Order Fulfillment Recipient + +Information about the fulfillment recipient. + +## Structure + +`OrderFulfillmentRecipient` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customerId` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `191` | +| `displayName` | `string \| null \| undefined` | Optional | 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`.
**Constraints**: *Maximum Length*: `255` | +| `emailAddress` | `string \| null \| undefined` | Optional | The email address of the fulfillment recipient.
If provided, the email address overrides the corresponding customer profile value
indicated by `customer_id`.
**Constraints**: *Maximum Length*: `255` | +| `phoneNumber` | `string \| null \| undefined` | Optional | 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`.
**Constraints**: *Maximum Length*: `17` | +| `address` | [`Address \| undefined`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | + +## Example (as JSON) + +```json +{ + "customer_id": "customer_id0", + "display_name": "display_name2", + "email_address": "email_address0", + "phone_number": "phone_number0", + "address": { + "address_line_1": "address_line_16", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "locality": "locality6", + "sublocality": "sublocality6" + } +} +``` + diff --git a/legacy/doc/models/order-fulfillment-shipment-details.md b/legacy/doc/models/order-fulfillment-shipment-details.md new file mode 100644 index 000000000..7dd36e45b --- /dev/null +++ b/legacy/doc/models/order-fulfillment-shipment-details.md @@ -0,0 +1,53 @@ + +# Order Fulfillment Shipment Details + +Contains the details necessary to fulfill a shipment order. + +## Structure + +`OrderFulfillmentShipmentDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `recipient` | [`OrderFulfillmentRecipient \| undefined`](../../doc/models/order-fulfillment-recipient.md) | Optional | Information about the fulfillment recipient. | +| `carrier` | `string \| null \| undefined` | Optional | The shipping carrier being used to ship this fulfillment (such as UPS, FedEx, or USPS).
**Constraints**: *Maximum Length*: `50` | +| `shippingNote` | `string \| null \| undefined` | Optional | A note with additional information for the shipping carrier.
**Constraints**: *Maximum Length*: `500` | +| `shippingType` | `string \| null \| undefined` | Optional | A description of the type of shipping product purchased from the carrier
(such as First Class, Priority, or Express).
**Constraints**: *Maximum Length*: `50` | +| `trackingNumber` | `string \| null \| undefined` | Optional | The reference number provided by the carrier to track the shipment's progress.
**Constraints**: *Maximum Length*: `100` | +| `trackingUrl` | `string \| null \| undefined` | Optional | A link to the tracking webpage on the carrier's website.
**Constraints**: *Maximum Length*: `2000` | +| `placedAt` | `string \| undefined` | Optional | 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"). | +| `inProgressAt` | `string \| undefined` | Optional | 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"). | +| `packagedAt` | `string \| undefined` | Optional | 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"). | +| `expectedShippedAt` | `string \| null \| undefined` | Optional | 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"). | +| `shippedAt` | `string \| undefined` | Optional | 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"). | +| `canceledAt` | `string \| null \| undefined` | Optional | 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"). | +| `cancelReason` | `string \| null \| undefined` | Optional | A description of why the shipment was canceled.
**Constraints**: *Maximum Length*: `100` | +| `failedAt` | `string \| undefined` | Optional | 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"). | +| `failureReason` | `string \| null \| undefined` | Optional | A description of why the shipment failed to be completed.
**Constraints**: *Maximum Length*: `100` | + +## Example (as JSON) + +```json +{ + "recipient": { + "customer_id": "customer_id6", + "display_name": "display_name8", + "email_address": "email_address4", + "phone_number": "phone_number4", + "address": { + "address_line_1": "address_line_16", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "locality": "locality6", + "sublocality": "sublocality6" + } + }, + "carrier": "carrier4", + "shipping_note": "shipping_note8", + "shipping_type": "shipping_type4", + "tracking_number": "tracking_number0" +} +``` + diff --git a/legacy/doc/models/order-fulfillment-state.md b/legacy/doc/models/order-fulfillment-state.md new file mode 100644 index 000000000..0885e8213 --- /dev/null +++ b/legacy/doc/models/order-fulfillment-state.md @@ -0,0 +1,20 @@ + +# Order Fulfillment State + +The current state of this fulfillment. + +## Enumeration + +`OrderFulfillmentState` + +## Fields + +| Name | Description | +| --- | --- | +| `PROPOSED` | Indicates that the fulfillment has been proposed. | +| `RESERVED` | Indicates that the fulfillment has been reserved. | +| `PREPARED` | Indicates that the fulfillment has been prepared. | +| `COMPLETED` | Indicates that the fulfillment was successfully completed. | +| `CANCELED` | Indicates that the fulfillment was canceled. | +| `FAILED` | Indicates that the fulfillment failed to be completed, but was not explicitly
canceled. | + diff --git a/legacy/doc/models/order-fulfillment-type.md b/legacy/doc/models/order-fulfillment-type.md new file mode 100644 index 000000000..7370fba83 --- /dev/null +++ b/legacy/doc/models/order-fulfillment-type.md @@ -0,0 +1,17 @@ + +# Order Fulfillment Type + +The type of fulfillment. + +## Enumeration + +`OrderFulfillmentType` + +## Fields + +| Name | Description | +| --- | --- | +| `PICKUP` | A recipient to pick up the fulfillment from a physical [location](../../doc/models/location.md). | +| `SHIPMENT` | A shipping carrier to ship the fulfillment. | +| `DELIVERY` | A courier to deliver the fulfillment. | + diff --git a/legacy/doc/models/order-fulfillment-updated-object.md b/legacy/doc/models/order-fulfillment-updated-object.md new file mode 100644 index 000000000..147ccd1d9 --- /dev/null +++ b/legacy/doc/models/order-fulfillment-updated-object.md @@ -0,0 +1,27 @@ + +# Order Fulfillment Updated Object + +## Structure + +`OrderFulfillmentUpdatedObject` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `orderFulfillmentUpdated` | [`OrderFulfillmentUpdated \| undefined`](../../doc/models/order-fulfillment-updated.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "order_fulfillment_updated": { + "order_id": "order_id8", + "version": 174, + "location_id": "location_id8", + "state": "CANCELED", + "created_at": "created_at2" + } +} +``` + diff --git a/legacy/doc/models/order-fulfillment-updated-update.md b/legacy/doc/models/order-fulfillment-updated-update.md new file mode 100644 index 000000000..badaeeefb --- /dev/null +++ b/legacy/doc/models/order-fulfillment-updated-update.md @@ -0,0 +1,27 @@ + +# Order Fulfillment Updated Update + +Information about fulfillment updates. + +## Structure + +`OrderFulfillmentUpdatedUpdate` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `fulfillmentUid` | `string \| null \| undefined` | Optional | A unique ID that identifies the fulfillment only within this order. | +| `oldState` | [`string \| undefined`](../../doc/models/fulfillment-state.md) | Optional | The current state of this fulfillment. | +| `newState` | [`string \| undefined`](../../doc/models/fulfillment-state.md) | Optional | The current state of this fulfillment. | + +## Example (as JSON) + +```json +{ + "fulfillment_uid": "fulfillment_uid6", + "old_state": "CANCELED", + "new_state": "PREPARED" +} +``` + diff --git a/legacy/doc/models/order-fulfillment-updated.md b/legacy/doc/models/order-fulfillment-updated.md new file mode 100644 index 000000000..136c4b2ac --- /dev/null +++ b/legacy/doc/models/order-fulfillment-updated.md @@ -0,0 +1,31 @@ + +# Order Fulfillment Updated + +## Structure + +`OrderFulfillmentUpdated` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `orderId` | `string \| null \| undefined` | Optional | The order's unique ID. | +| `version` | `number \| undefined` | Optional | 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) | +| `locationId` | `string \| null \| undefined` | Optional | The ID of the seller location that this order is associated with. | +| `state` | [`string \| undefined`](../../doc/models/order-state.md) | Optional | The state of the order. | +| `createdAt` | `string \| undefined` | Optional | The timestamp for when the order was created, in RFC 3339 format. | +| `updatedAt` | `string \| undefined` | Optional | The timestamp for when the order was last updated, in RFC 3339 format. | +| `fulfillmentUpdate` | [`OrderFulfillmentUpdatedUpdate[] \| null \| undefined`](../../doc/models/order-fulfillment-updated-update.md) | Optional | The fulfillments that were updated with this version change. | + +## Example (as JSON) + +```json +{ + "order_id": "order_id0", + "version": 8, + "location_id": "location_id0", + "state": "OPEN", + "created_at": "created_at4" +} +``` + diff --git a/legacy/doc/models/order-fulfillment.md b/legacy/doc/models/order-fulfillment.md new file mode 100644 index 000000000..833339546 --- /dev/null +++ b/legacy/doc/models/order-fulfillment.md @@ -0,0 +1,68 @@ + +# Order Fulfillment + +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. + +## Structure + +`OrderFulfillment` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string \| null \| undefined` | Optional | A unique ID that identifies the fulfillment only within this order.
**Constraints**: *Maximum Length*: `60` | +| `type` | [`string \| undefined`](../../doc/models/order-fulfillment-type.md) | Optional | The type of fulfillment. | +| `state` | [`string \| undefined`](../../doc/models/order-fulfillment-state.md) | Optional | The current state of this fulfillment. | +| `lineItemApplication` | [`string \| undefined`](../../doc/models/order-fulfillment-fulfillment-line-item-application.md) | Optional | 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. | +| `entries` | [`OrderFulfillmentFulfillmentEntry[] \| undefined`](../../doc/models/order-fulfillment-fulfillment-entry.md) | Optional | 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. | +| `metadata` | `Record \| null \| undefined` | Optional | 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). | +| `pickupDetails` | [`OrderFulfillmentPickupDetails \| undefined`](../../doc/models/order-fulfillment-pickup-details.md) | Optional | Contains details necessary to fulfill a pickup order. | +| `shipmentDetails` | [`OrderFulfillmentShipmentDetails \| undefined`](../../doc/models/order-fulfillment-shipment-details.md) | Optional | Contains the details necessary to fulfill a shipment order. | +| `deliveryDetails` | [`OrderFulfillmentDeliveryDetails \| undefined`](../../doc/models/order-fulfillment-delivery-details.md) | Optional | Describes delivery details of an order fulfillment. | + +## Example (as JSON) + +```json +{ + "uid": "uid8", + "type": "PICKUP", + "state": "PROPOSED", + "line_item_application": "ALL", + "entries": [ + { + "uid": "uid0", + "line_item_uid": "line_item_uid0", + "quantity": "quantity6", + "metadata": { + "key0": "metadata3", + "key1": "metadata4", + "key2": "metadata5" + } + }, + { + "uid": "uid0", + "line_item_uid": "line_item_uid0", + "quantity": "quantity6", + "metadata": { + "key0": "metadata3", + "key1": "metadata4", + "key2": "metadata5" + } + }, + { + "uid": "uid0", + "line_item_uid": "line_item_uid0", + "quantity": "quantity6", + "metadata": { + "key0": "metadata3", + "key1": "metadata4", + "key2": "metadata5" + } + } + ] +} +``` + diff --git a/legacy/doc/models/order-line-item-applied-discount.md b/legacy/doc/models/order-line-item-applied-discount.md new file mode 100644 index 000000000..5e68490cb --- /dev/null +++ b/legacy/doc/models/order-line-item-applied-discount.md @@ -0,0 +1,35 @@ + +# Order Line Item Applied Discount + +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. + +## Structure + +`OrderLineItemAppliedDiscount` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string \| null \| undefined` | Optional | A unique ID that identifies the applied discount only within this order.
**Constraints**: *Maximum Length*: `60` | +| `discountUid` | `string` | Required | 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`.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `60` | +| `appliedMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "uid": "uid2", + "discount_uid": "discount_uid2", + "applied_money": { + "amount": 196, + "currency": "AMD" + } +} +``` + diff --git a/legacy/doc/models/order-line-item-applied-service-charge.md b/legacy/doc/models/order-line-item-applied-service-charge.md new file mode 100644 index 000000000..5afc60a51 --- /dev/null +++ b/legacy/doc/models/order-line-item-applied-service-charge.md @@ -0,0 +1,28 @@ + +# Order Line Item Applied Service Charge + +## Structure + +`OrderLineItemAppliedServiceCharge` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string \| null \| undefined` | Optional | A unique ID that identifies the applied service charge only within this order.
**Constraints**: *Maximum Length*: `60` | +| `serviceChargeUid` | `string` | Required | 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`.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `60` | +| `appliedMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "uid": "uid8", + "service_charge_uid": "service_charge_uid8", + "applied_money": { + "amount": 196, + "currency": "AMD" + } +} +``` + diff --git a/legacy/doc/models/order-line-item-applied-tax.md b/legacy/doc/models/order-line-item-applied-tax.md new file mode 100644 index 000000000..0f5767667 --- /dev/null +++ b/legacy/doc/models/order-line-item-applied-tax.md @@ -0,0 +1,35 @@ + +# Order Line Item Applied Tax + +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. + +## Structure + +`OrderLineItemAppliedTax` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string \| null \| undefined` | Optional | A unique ID that identifies the applied tax only within this order.
**Constraints**: *Maximum Length*: `60` | +| `taxUid` | `string` | Required | 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`.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `60` | +| `appliedMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "uid": "uid8", + "tax_uid": "tax_uid6", + "applied_money": { + "amount": 196, + "currency": "AMD" + } +} +``` + diff --git a/legacy/doc/models/order-line-item-discount-scope.md b/legacy/doc/models/order-line-item-discount-scope.md new file mode 100644 index 000000000..ccb5bb8a8 --- /dev/null +++ b/legacy/doc/models/order-line-item-discount-scope.md @@ -0,0 +1,17 @@ + +# Order Line Item Discount Scope + +Indicates whether this is a line-item or order-level discount. + +## Enumeration + +`OrderLineItemDiscountScope` + +## Fields + +| Name | Description | +| --- | --- | +| `OTHER_DISCOUNT_SCOPE` | Used for reporting only.
The original transaction discount scope is currently not supported by the API. | +| `LINE_ITEM` | The discount should be applied to only line items specified by
`OrderLineItemAppliedDiscount` reference records. | +| `ORDER` | The discount should be applied to the entire order. | + diff --git a/legacy/doc/models/order-line-item-discount-type.md b/legacy/doc/models/order-line-item-discount-type.md new file mode 100644 index 000000000..99dc297fe --- /dev/null +++ b/legacy/doc/models/order-line-item-discount-type.md @@ -0,0 +1,19 @@ + +# Order Line Item Discount Type + +Indicates how the discount is applied to the associated line item or order. + +## Enumeration + +`OrderLineItemDiscountType` + +## Fields + +| Name | Description | +| --- | --- | +| `UNKNOWN_DISCOUNT` | Used for reporting only.
The original transaction discount type is currently not supported by the API. | +| `FIXED_PERCENTAGE` | Apply the discount as a fixed percentage (such as 5%) off the item price. | +| `FIXED_AMOUNT` | Apply the discount as a fixed monetary value (such as $1.00) off the item price. | +| `VARIABLE_PERCENTAGE` | Apply the discount as a variable percentage based on the item
price.

The specific discount percentage of a `VARIABLE_PERCENTAGE` discount
is assigned at the time of the purchase. | +| `VARIABLE_AMOUNT` | Apply the discount as a variable amount based on the item price.

The specific discount amount of a `VARIABLE_AMOUNT` discount
is assigned at the time of the purchase. | + diff --git a/legacy/doc/models/order-line-item-discount.md b/legacy/doc/models/order-line-item-discount.md new file mode 100644 index 000000000..bc9bff611 --- /dev/null +++ b/legacy/doc/models/order-line-item-discount.md @@ -0,0 +1,43 @@ + +# Order Line Item Discount + +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. + +## Structure + +`OrderLineItemDiscount` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string \| null \| undefined` | Optional | A unique ID that identifies the discount only within this order.
**Constraints**: *Maximum Length*: `60` | +| `catalogObjectId` | `string \| null \| undefined` | Optional | The catalog object ID referencing [CatalogDiscount](entity:CatalogDiscount).
**Constraints**: *Maximum Length*: `192` | +| `catalogVersion` | `bigint \| null \| undefined` | Optional | The version of the catalog object that this discount references. | +| `name` | `string \| null \| undefined` | Optional | The discount's name.
**Constraints**: *Maximum Length*: `255` | +| `type` | [`string \| undefined`](../../doc/models/order-line-item-discount-type.md) | Optional | Indicates how the discount is applied to the associated line item or order. | +| `percentage` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `10` | +| `amountMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `appliedMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `metadata` | `Record \| null \| undefined` | Optional | 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` | [`string \| undefined`](../../doc/models/order-line-item-discount-scope.md) | Optional | Indicates whether this is a line-item or order-level discount. | +| `rewardIds` | `string[] \| undefined` | Optional | 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. | +| `pricingRuleId` | `string \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "uid": "uid4", + "catalog_object_id": "catalog_object_id8", + "catalog_version": 54, + "name": "name4", + "type": "FIXED_PERCENTAGE" +} +``` + diff --git a/legacy/doc/models/order-line-item-item-type.md b/legacy/doc/models/order-line-item-item-type.md new file mode 100644 index 000000000..70c09fb02 --- /dev/null +++ b/legacy/doc/models/order-line-item-item-type.md @@ -0,0 +1,17 @@ + +# Order Line Item Item Type + +Represents the line item type. + +## Enumeration + +`OrderLineItemItemType` + +## Fields + +| Name | Description | +| --- | --- | +| `ITEM` | Indicates that the line item is an itemized sale. | +| `CUSTOM_AMOUNT` | Indicates that the line item is a non-itemized sale. | +| `GIFT_CARD` | Indicates that the line item is a gift card sale. Gift cards sold through
the Orders API are sold in an unactivated state and can be activated through the
Gift Cards API using the line item `uid`. | + diff --git a/legacy/doc/models/order-line-item-modifier.md b/legacy/doc/models/order-line-item-modifier.md new file mode 100644 index 000000000..6e99a4e16 --- /dev/null +++ b/legacy/doc/models/order-line-item-modifier.md @@ -0,0 +1,34 @@ + +# Order Line Item Modifier + +A [CatalogModifier](../../doc/models/catalog-modifier.md). + +## Structure + +`OrderLineItemModifier` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string \| null \| undefined` | Optional | A unique ID that identifies the modifier only within this order.
**Constraints**: *Maximum Length*: `60` | +| `catalogObjectId` | `string \| null \| undefined` | Optional | The catalog object ID referencing [CatalogModifier](entity:CatalogModifier).
**Constraints**: *Maximum Length*: `192` | +| `catalogVersion` | `bigint \| null \| undefined` | Optional | The version of the catalog object that this modifier references. | +| `name` | `string \| null \| undefined` | Optional | The name of the item modifier.
**Constraints**: *Maximum Length*: `255` | +| `quantity` | `string \| null \| undefined` | Optional | 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. | +| `basePriceMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `totalPriceMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `metadata` | `Record \| null \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "uid": "uid2", + "catalog_object_id": "catalog_object_id6", + "catalog_version": 134, + "name": "name2", + "quantity": "quantity8" +} +``` + diff --git a/legacy/doc/models/order-line-item-pricing-blocklists-blocked-discount.md b/legacy/doc/models/order-line-item-pricing-blocklists-blocked-discount.md new file mode 100644 index 000000000..32c08d84d --- /dev/null +++ b/legacy/doc/models/order-line-item-pricing-blocklists-blocked-discount.md @@ -0,0 +1,28 @@ + +# Order Line Item Pricing Blocklists Blocked Discount + +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. + +## Structure + +`OrderLineItemPricingBlocklistsBlockedDiscount` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string \| null \| undefined` | Optional | A unique ID of the `BlockedDiscount` within the order.
**Constraints**: *Maximum Length*: `60` | +| `discountUid` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `60` | +| `discountCatalogObjectId` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `192` | + +## Example (as JSON) + +```json +{ + "uid": "uid6", + "discount_uid": "discount_uid8", + "discount_catalog_object_id": "discount_catalog_object_id8" +} +``` + diff --git a/legacy/doc/models/order-line-item-pricing-blocklists-blocked-tax.md b/legacy/doc/models/order-line-item-pricing-blocklists-blocked-tax.md new file mode 100644 index 000000000..191c6cd71 --- /dev/null +++ b/legacy/doc/models/order-line-item-pricing-blocklists-blocked-tax.md @@ -0,0 +1,28 @@ + +# Order Line Item Pricing Blocklists Blocked Tax + +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. + +## Structure + +`OrderLineItemPricingBlocklistsBlockedTax` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string \| null \| undefined` | Optional | A unique ID of the `BlockedTax` within the order.
**Constraints**: *Maximum Length*: `60` | +| `taxUid` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `60` | +| `taxCatalogObjectId` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `192` | + +## Example (as JSON) + +```json +{ + "uid": "uid8", + "tax_uid": "tax_uid4", + "tax_catalog_object_id": "tax_catalog_object_id2" +} +``` + diff --git a/legacy/doc/models/order-line-item-pricing-blocklists.md b/legacy/doc/models/order-line-item-pricing-blocklists.md new file mode 100644 index 000000000..2a5dae4e1 --- /dev/null +++ b/legacy/doc/models/order-line-item-pricing-blocklists.md @@ -0,0 +1,54 @@ + +# Order Line Item Pricing Blocklists + +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). + +## Structure + +`OrderLineItemPricingBlocklists` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `blockedDiscounts` | [`OrderLineItemPricingBlocklistsBlockedDiscount[] \| null \| undefined`](../../doc/models/order-line-item-pricing-blocklists-blocked-discount.md) | Optional | 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). | +| `blockedTaxes` | [`OrderLineItemPricingBlocklistsBlockedTax[] \| null \| undefined`](../../doc/models/order-line-item-pricing-blocklists-blocked-tax.md) | Optional | 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). | + +## Example (as JSON) + +```json +{ + "blocked_discounts": [ + { + "uid": "uid0", + "discount_uid": "discount_uid6", + "discount_catalog_object_id": "discount_catalog_object_id2" + }, + { + "uid": "uid0", + "discount_uid": "discount_uid6", + "discount_catalog_object_id": "discount_catalog_object_id2" + }, + { + "uid": "uid0", + "discount_uid": "discount_uid6", + "discount_catalog_object_id": "discount_catalog_object_id2" + } + ], + "blocked_taxes": [ + { + "uid": "uid4", + "tax_uid": "tax_uid0", + "tax_catalog_object_id": "tax_catalog_object_id8" + }, + { + "uid": "uid4", + "tax_uid": "tax_uid0", + "tax_catalog_object_id": "tax_catalog_object_id8" + } + ] +} +``` + diff --git a/legacy/doc/models/order-line-item-tax-scope.md b/legacy/doc/models/order-line-item-tax-scope.md new file mode 100644 index 000000000..3a27c8fde --- /dev/null +++ b/legacy/doc/models/order-line-item-tax-scope.md @@ -0,0 +1,17 @@ + +# Order Line Item Tax Scope + +Indicates whether this is a line-item or order-level tax. + +## Enumeration + +`OrderLineItemTaxScope` + +## Fields + +| Name | Description | +| --- | --- | +| `OTHER_TAX_SCOPE` | Used for reporting only.
The original transaction tax scope is currently not supported by the API. | +| `LINE_ITEM` | The tax should be applied only to line items specified by
the `OrderLineItemAppliedTax` reference records. | +| `ORDER` | The tax should be applied to the entire order. | + diff --git a/legacy/doc/models/order-line-item-tax-type.md b/legacy/doc/models/order-line-item-tax-type.md new file mode 100644 index 000000000..780dfa36e --- /dev/null +++ b/legacy/doc/models/order-line-item-tax-type.md @@ -0,0 +1,17 @@ + +# Order Line Item Tax Type + +Indicates how the tax is applied to the associated line item or order. + +## Enumeration + +`OrderLineItemTaxType` + +## Fields + +| Name | Description | +| --- | --- | +| `UNKNOWN_TAX` | Used for reporting only.
The original transaction tax type is currently not supported by the API. | +| `ADDITIVE` | The tax is an additive tax. The tax amount is added on top of the price.
For example, an item with a cost of 1.00 USD and a 10% additive tax has a total
cost to the buyer of 1.10 USD. | +| `INCLUSIVE` | The tax is an inclusive tax. Inclusive taxes are already included
in the line item price or order total. For example, an item with a cost of
1.00 USD and a 10% inclusive tax has a pretax cost of 0.91 USD
(91 cents) and a 0.09 (9 cents) tax for a total cost of 1.00 USD to
the buyer. | + diff --git a/legacy/doc/models/order-line-item-tax.md b/legacy/doc/models/order-line-item-tax.md new file mode 100644 index 000000000..cabd6afa2 --- /dev/null +++ b/legacy/doc/models/order-line-item-tax.md @@ -0,0 +1,40 @@ + +# Order Line Item Tax + +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. + +## Structure + +`OrderLineItemTax` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string \| null \| undefined` | Optional | A unique ID that identifies the tax only within this order.
**Constraints**: *Maximum Length*: `60` | +| `catalogObjectId` | `string \| null \| undefined` | Optional | The catalog object ID referencing [CatalogTax](entity:CatalogTax).
**Constraints**: *Maximum Length*: `192` | +| `catalogVersion` | `bigint \| null \| undefined` | Optional | The version of the catalog object that this tax references. | +| `name` | `string \| null \| undefined` | Optional | The tax's name.
**Constraints**: *Maximum Length*: `255` | +| `type` | [`string \| undefined`](../../doc/models/order-line-item-tax-type.md) | Optional | Indicates how the tax is applied to the associated line item or order. | +| `percentage` | `string \| null \| undefined` | Optional | 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%.
**Constraints**: *Maximum Length*: `10` | +| `metadata` | `Record \| null \| undefined` | Optional | 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). | +| `appliedMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `scope` | [`string \| undefined`](../../doc/models/order-line-item-tax-scope.md) | Optional | Indicates whether this is a line-item or order-level tax. | +| `autoApplied` | `boolean \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "uid": "uid4", + "catalog_object_id": "catalog_object_id2", + "catalog_version": 190, + "name": "name4", + "type": "ADDITIVE" +} +``` + diff --git a/legacy/doc/models/order-line-item.md b/legacy/doc/models/order-line-item.md new file mode 100644 index 000000000..6a0039828 --- /dev/null +++ b/legacy/doc/models/order-line-item.md @@ -0,0 +1,64 @@ + +# Order Line Item + +Represents a line item in an order. Each line item describes a different +product to purchase, with its own quantity and price details. + +## Structure + +`OrderLineItem` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string \| null \| undefined` | Optional | A unique ID that identifies the line item only within this order.
**Constraints**: *Maximum Length*: `60` | +| `name` | `string \| null \| undefined` | Optional | The name of the line item.
**Constraints**: *Maximum Length*: `512` | +| `quantity` | `string` | Required | 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.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `12` | +| `quantityUnit` | [`OrderQuantityUnit \| undefined`](../../doc/models/order-quantity-unit.md) | Optional | Contains the measurement unit for a quantity and a precision that
specifies the number of digits after the decimal point for decimal quantities. | +| `note` | `string \| null \| undefined` | Optional | An optional note associated with the line item.
**Constraints**: *Maximum Length*: `2000` | +| `catalogObjectId` | `string \| null \| undefined` | Optional | The [CatalogItemVariation](entity:CatalogItemVariation) ID applied to this line item.
**Constraints**: *Maximum Length*: `192` | +| `catalogVersion` | `bigint \| null \| undefined` | Optional | The version of the catalog object that this line item references. | +| `variationName` | `string \| null \| undefined` | Optional | The name of the variation applied to this line item.
**Constraints**: *Maximum Length*: `400` | +| `itemType` | [`string \| undefined`](../../doc/models/order-line-item-item-type.md) | Optional | Represents the line item type. | +| `metadata` | `Record \| null \| undefined` | Optional | 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` | [`OrderLineItemModifier[] \| null \| undefined`](../../doc/models/order-line-item-modifier.md) | Optional | The [CatalogModifier](entity:CatalogModifier)s applied to this line item. | +| `appliedTaxes` | [`OrderLineItemAppliedTax[] \| null \| undefined`](../../doc/models/order-line-item-applied-tax.md) | Optional | 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. | +| `appliedDiscounts` | [`OrderLineItemAppliedDiscount[] \| null \| undefined`](../../doc/models/order-line-item-applied-discount.md) | Optional | 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. | +| `appliedServiceCharges` | [`OrderLineItemAppliedServiceCharge[] \| null \| undefined`](../../doc/models/order-line-item-applied-service-charge.md) | Optional | 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. | +| `basePriceMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `variationTotalPriceMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `grossSalesMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `totalTaxMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `totalDiscountMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `totalMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `pricingBlocklists` | [`OrderLineItemPricingBlocklists \| undefined`](../../doc/models/order-line-item-pricing-blocklists.md) | Optional | 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). | +| `totalServiceChargeMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "uid": "uid4", + "name": "name4", + "quantity": "quantity0", + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note0", + "catalog_object_id": "catalog_object_id8" +} +``` + diff --git a/legacy/doc/models/order-money-amounts.md b/legacy/doc/models/order-money-amounts.md new file mode 100644 index 000000000..b37cfaf33 --- /dev/null +++ b/legacy/doc/models/order-money-amounts.md @@ -0,0 +1,46 @@ + +# Order Money Amounts + +A collection of various money amounts. + +## Structure + +`OrderMoneyAmounts` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `totalMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `taxMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `discountMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `tipMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `serviceChargeMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "total_money": { + "amount": 250, + "currency": "UAH" + }, + "tax_money": { + "amount": 58, + "currency": "IRR" + }, + "discount_money": { + "amount": 92, + "currency": "PAB" + }, + "tip_money": { + "amount": 190, + "currency": "TWD" + }, + "service_charge_money": { + "amount": 160, + "currency": "XCD" + } +} +``` + diff --git a/legacy/doc/models/order-pricing-options.md b/legacy/doc/models/order-pricing-options.md new file mode 100644 index 000000000..8a68c2636 --- /dev/null +++ b/legacy/doc/models/order-pricing-options.md @@ -0,0 +1,27 @@ + +# Order Pricing Options + +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](../../doc/models/catalog-pricing-rule.md). + +## Structure + +`OrderPricingOptions` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `autoApplyDiscounts` | `boolean \| null \| undefined` | Optional | The option to determine whether pricing rule-based
discounts are automatically applied to an order. | +| `autoApplyTaxes` | `boolean \| null \| undefined` | Optional | The option to determine whether rule-based taxes are automatically
applied to an order when the criteria of the corresponding rules are met. | + +## Example (as JSON) + +```json +{ + "auto_apply_discounts": false, + "auto_apply_taxes": false +} +``` + diff --git a/legacy/doc/models/order-quantity-unit.md b/legacy/doc/models/order-quantity-unit.md new file mode 100644 index 000000000..13d68158e --- /dev/null +++ b/legacy/doc/models/order-quantity-unit.md @@ -0,0 +1,39 @@ + +# Order Quantity Unit + +Contains the measurement unit for a quantity and a precision that +specifies the number of digits after the decimal point for decimal quantities. + +## Structure + +`OrderQuantityUnit` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `measurementUnit` | [`MeasurementUnit \| undefined`](../../doc/models/measurement-unit.md) | Optional | 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`. | +| `precision` | `number \| null \| undefined` | Optional | 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. | +| `catalogObjectId` | `string \| null \| undefined` | Optional | The catalog object ID referencing the
[CatalogMeasurementUnit](entity:CatalogMeasurementUnit).

This field is set when this is a catalog-backed measurement unit. | +| `catalogVersion` | `bigint \| null \| undefined` | Optional | The version of the catalog object that this measurement unit references.

This field is set when this is a catalog-backed measurement unit. | + +## Example (as JSON) + +```json +{ + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 144, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 78 +} +``` + diff --git a/legacy/doc/models/order-return-discount.md b/legacy/doc/models/order-return-discount.md new file mode 100644 index 000000000..202f52bbb --- /dev/null +++ b/legacy/doc/models/order-return-discount.md @@ -0,0 +1,41 @@ + +# Order Return Discount + +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. + +## Structure + +`OrderReturnDiscount` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string \| null \| undefined` | Optional | A unique ID that identifies the returned discount only within this order.
**Constraints**: *Maximum Length*: `60` | +| `sourceDiscountUid` | `string \| null \| undefined` | Optional | The discount `uid` from the order that contains the original application of this discount.
**Constraints**: *Maximum Length*: `60` | +| `catalogObjectId` | `string \| null \| undefined` | Optional | The catalog object ID referencing [CatalogDiscount](entity:CatalogDiscount).
**Constraints**: *Maximum Length*: `192` | +| `catalogVersion` | `bigint \| null \| undefined` | Optional | The version of the catalog object that this discount references. | +| `name` | `string \| null \| undefined` | Optional | The discount's name.
**Constraints**: *Maximum Length*: `255` | +| `type` | [`string \| undefined`](../../doc/models/order-line-item-discount-type.md) | Optional | Indicates how the discount is applied to the associated line item or order. | +| `percentage` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `10` | +| `amountMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `appliedMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `scope` | [`string \| undefined`](../../doc/models/order-line-item-discount-scope.md) | Optional | Indicates whether this is a line-item or order-level discount. | + +## Example (as JSON) + +```json +{ + "uid": "uid2", + "source_discount_uid": "source_discount_uid2", + "catalog_object_id": "catalog_object_id4", + "catalog_version": 188, + "name": "name2" +} +``` + diff --git a/legacy/doc/models/order-return-line-item-modifier.md b/legacy/doc/models/order-return-line-item-modifier.md new file mode 100644 index 000000000..e7450e8d7 --- /dev/null +++ b/legacy/doc/models/order-return-line-item-modifier.md @@ -0,0 +1,34 @@ + +# Order Return Line Item Modifier + +A line item modifier being returned. + +## Structure + +`OrderReturnLineItemModifier` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string \| null \| undefined` | Optional | A unique ID that identifies the return modifier only within this order.
**Constraints**: *Maximum Length*: `60` | +| `sourceModifierUid` | `string \| null \| undefined` | Optional | The modifier `uid` from the order's line item that contains the
original sale of this line item modifier.
**Constraints**: *Maximum Length*: `60` | +| `catalogObjectId` | `string \| null \| undefined` | Optional | The catalog object ID referencing [CatalogModifier](entity:CatalogModifier).
**Constraints**: *Maximum Length*: `192` | +| `catalogVersion` | `bigint \| null \| undefined` | Optional | The version of the catalog object that this line item modifier references. | +| `name` | `string \| null \| undefined` | Optional | The name of the item modifier.
**Constraints**: *Maximum Length*: `255` | +| `basePriceMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `totalPriceMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `quantity` | `string \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "uid": "uid4", + "source_modifier_uid": "source_modifier_uid8", + "catalog_object_id": "catalog_object_id8", + "catalog_version": 46, + "name": "name4" +} +``` + diff --git a/legacy/doc/models/order-return-line-item.md b/legacy/doc/models/order-return-line-item.md new file mode 100644 index 000000000..42df14ae0 --- /dev/null +++ b/legacy/doc/models/order-return-line-item.md @@ -0,0 +1,62 @@ + +# Order Return Line Item + +The line item being returned in an order. + +## Structure + +`OrderReturnLineItem` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string \| null \| undefined` | Optional | A unique ID for this return line-item entry.
**Constraints**: *Maximum Length*: `60` | +| `sourceLineItemUid` | `string \| null \| undefined` | Optional | The `uid` of the line item in the original sale order.
**Constraints**: *Maximum Length*: `60` | +| `name` | `string \| null \| undefined` | Optional | The name of the line item.
**Constraints**: *Maximum Length*: `512` | +| `quantity` | `string` | Required | 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"`.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `12` | +| `quantityUnit` | [`OrderQuantityUnit \| undefined`](../../doc/models/order-quantity-unit.md) | Optional | Contains the measurement unit for a quantity and a precision that
specifies the number of digits after the decimal point for decimal quantities. | +| `note` | `string \| null \| undefined` | Optional | The note of the return line item.
**Constraints**: *Maximum Length*: `2000` | +| `catalogObjectId` | `string \| null \| undefined` | Optional | The [CatalogItemVariation](entity:CatalogItemVariation) ID applied to this return line item.
**Constraints**: *Maximum Length*: `192` | +| `catalogVersion` | `bigint \| null \| undefined` | Optional | The version of the catalog object that this line item references. | +| `variationName` | `string \| null \| undefined` | Optional | The name of the variation applied to this return line item.
**Constraints**: *Maximum Length*: `400` | +| `itemType` | [`string \| undefined`](../../doc/models/order-line-item-item-type.md) | Optional | Represents the line item type. | +| `returnModifiers` | [`OrderReturnLineItemModifier[] \| null \| undefined`](../../doc/models/order-return-line-item-modifier.md) | Optional | The [CatalogModifier](entity:CatalogModifier)s applied to this line item. | +| `appliedTaxes` | [`OrderLineItemAppliedTax[] \| null \| undefined`](../../doc/models/order-line-item-applied-tax.md) | Optional | 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. | +| `appliedDiscounts` | [`OrderLineItemAppliedDiscount[] \| null \| undefined`](../../doc/models/order-line-item-applied-discount.md) | Optional | 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. | +| `basePriceMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `variationTotalPriceMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `grossReturnMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `totalTaxMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `totalDiscountMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `totalMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `appliedServiceCharges` | [`OrderLineItemAppliedServiceCharge[] \| null \| undefined`](../../doc/models/order-line-item-applied-service-charge.md) | Optional | 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. | +| `totalServiceChargeMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "uid": "uid2", + "source_line_item_uid": "source_line_item_uid0", + "name": "name2", + "quantity": "quantity8", + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note8" +} +``` + diff --git a/legacy/doc/models/order-return-service-charge.md b/legacy/doc/models/order-return-service-charge.md new file mode 100644 index 000000000..6b48a2060 --- /dev/null +++ b/legacy/doc/models/order-return-service-charge.md @@ -0,0 +1,41 @@ + +# Order Return Service Charge + +Represents the service charge applied to the original order. + +## Structure + +`OrderReturnServiceCharge` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string \| null \| undefined` | Optional | A unique ID that identifies the return service charge only within this order.
**Constraints**: *Maximum Length*: `60` | +| `sourceServiceChargeUid` | `string \| null \| undefined` | Optional | The service charge `uid` from the order containing the original
service charge. `source_service_charge_uid` is `null` for
unlinked returns.
**Constraints**: *Maximum Length*: `60` | +| `name` | `string \| null \| undefined` | Optional | The name of the service charge.
**Constraints**: *Maximum Length*: `255` | +| `catalogObjectId` | `string \| null \| undefined` | Optional | The catalog object ID of the associated [OrderServiceCharge](entity:OrderServiceCharge).
**Constraints**: *Maximum Length*: `192` | +| `catalogVersion` | `bigint \| null \| undefined` | Optional | The version of the catalog object that this service charge references. | +| `percentage` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `10` | +| `amountMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `appliedMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `totalMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `totalTaxMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `calculationPhase` | [`string \| undefined`](../../doc/models/order-service-charge-calculation-phase.md) | Optional | 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) | +| `taxable` | `boolean \| null \| undefined` | Optional | Indicates whether the surcharge can be taxed. Service charges
calculated in the `TOTAL_PHASE` cannot be marked as taxable. | +| `appliedTaxes` | [`OrderLineItemAppliedTax[] \| null \| undefined`](../../doc/models/order-line-item-applied-tax.md) | Optional | 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. | +| `treatmentType` | [`string \| undefined`](../../doc/models/order-service-charge-treatment-type.md) | Optional | Indicates whether the service charge will be treated as a value-holding line item or
apportioned toward a line item. | +| `scope` | [`string \| undefined`](../../doc/models/order-service-charge-scope.md) | Optional | Indicates whether this is a line-item or order-level apportioned
service charge. | + +## Example (as JSON) + +```json +{ + "uid": "uid0", + "source_service_charge_uid": "source_service_charge_uid6", + "name": "name0", + "catalog_object_id": "catalog_object_id4", + "catalog_version": 18 +} +``` + diff --git a/legacy/doc/models/order-return-tax.md b/legacy/doc/models/order-return-tax.md new file mode 100644 index 000000000..0d88ccc2f --- /dev/null +++ b/legacy/doc/models/order-return-tax.md @@ -0,0 +1,39 @@ + +# Order Return Tax + +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. + +## Structure + +`OrderReturnTax` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string \| null \| undefined` | Optional | A unique ID that identifies the returned tax only within this order.
**Constraints**: *Maximum Length*: `60` | +| `sourceTaxUid` | `string \| null \| undefined` | Optional | The tax `uid` from the order that contains the original tax charge.
**Constraints**: *Maximum Length*: `60` | +| `catalogObjectId` | `string \| null \| undefined` | Optional | The catalog object ID referencing [CatalogTax](entity:CatalogTax).
**Constraints**: *Maximum Length*: `192` | +| `catalogVersion` | `bigint \| null \| undefined` | Optional | The version of the catalog object that this tax references. | +| `name` | `string \| null \| undefined` | Optional | The tax's name.
**Constraints**: *Maximum Length*: `255` | +| `type` | [`string \| undefined`](../../doc/models/order-line-item-tax-type.md) | Optional | Indicates how the tax is applied to the associated line item or order. | +| `percentage` | `string \| null \| undefined` | Optional | 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%.
**Constraints**: *Maximum Length*: `10` | +| `appliedMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `scope` | [`string \| undefined`](../../doc/models/order-line-item-tax-scope.md) | Optional | Indicates whether this is a line-item or order-level tax. | + +## Example (as JSON) + +```json +{ + "uid": "uid4", + "source_tax_uid": "source_tax_uid2", + "catalog_object_id": "catalog_object_id8", + "catalog_version": 124, + "name": "name4" +} +``` + diff --git a/legacy/doc/models/order-return-tip.md b/legacy/doc/models/order-return-tip.md new file mode 100644 index 000000000..a40d5b151 --- /dev/null +++ b/legacy/doc/models/order-return-tip.md @@ -0,0 +1,32 @@ + +# Order Return Tip + +A tip being returned. + +## Structure + +`OrderReturnTip` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string \| null \| undefined` | Optional | A unique ID that identifies the tip only within this order.
**Constraints**: *Maximum Length*: `60` | +| `appliedMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `sourceTenderUid` | `string \| null \| undefined` | Optional | The tender `uid` from the order that contains the original application of this tip.
**Constraints**: *Maximum Length*: `192` | +| `sourceTenderId` | `string \| null \| undefined` | Optional | The tender `id` from the order that contains the original application of this tip.
**Constraints**: *Maximum Length*: `192` | + +## Example (as JSON) + +```json +{ + "uid": "uid4", + "applied_money": { + "amount": 196, + "currency": "AMD" + }, + "source_tender_uid": "source_tender_uid6", + "source_tender_id": "source_tender_id0" +} +``` + diff --git a/legacy/doc/models/order-return.md b/legacy/doc/models/order-return.md new file mode 100644 index 000000000..bad1ee16c --- /dev/null +++ b/legacy/doc/models/order-return.md @@ -0,0 +1,95 @@ + +# Order Return + +The set of line items, service charges, taxes, discounts, tips, and other items being returned in an order. + +## Structure + +`OrderReturn` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string \| null \| undefined` | Optional | A unique ID that identifies the return only within this order.
**Constraints**: *Maximum Length*: `60` | +| `sourceOrderId` | `string \| null \| undefined` | Optional | An order that contains the original sale of these return line items. This is unset
for unlinked returns. | +| `returnLineItems` | [`OrderReturnLineItem[] \| null \| undefined`](../../doc/models/order-return-line-item.md) | Optional | A collection of line items that are being returned. | +| `returnServiceCharges` | [`OrderReturnServiceCharge[] \| null \| undefined`](../../doc/models/order-return-service-charge.md) | Optional | A collection of service charges that are being returned. | +| `returnTaxes` | [`OrderReturnTax[] \| undefined`](../../doc/models/order-return-tax.md) | Optional | 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. | +| `returnDiscounts` | [`OrderReturnDiscount[] \| undefined`](../../doc/models/order-return-discount.md) | Optional | 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. | +| `returnTips` | [`OrderReturnTip[] \| null \| undefined`](../../doc/models/order-return-tip.md) | Optional | A collection of references to tips being returned for an order. | +| `roundingAdjustment` | [`OrderRoundingAdjustment \| undefined`](../../doc/models/order-rounding-adjustment.md) | Optional | 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. | +| `returnAmounts` | [`OrderMoneyAmounts \| undefined`](../../doc/models/order-money-amounts.md) | Optional | A collection of various money amounts. | + +## Example (as JSON) + +```json +{ + "uid": "uid2", + "source_order_id": "source_order_id0", + "return_line_items": [ + { + "uid": "uid0", + "source_line_item_uid": "source_line_item_uid2", + "name": "name0", + "quantity": "quantity6", + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note4" + } + ], + "return_service_charges": [ + { + "uid": "uid6", + "source_service_charge_uid": "source_service_charge_uid0", + "name": "name6", + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + { + "uid": "uid6", + "source_service_charge_uid": "source_service_charge_uid0", + "name": "name6", + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + } + ], + "return_taxes": [ + { + "uid": "uid2", + "source_tax_uid": "source_tax_uid0", + "catalog_object_id": "catalog_object_id4", + "catalog_version": 106, + "name": "name2" + }, + { + "uid": "uid2", + "source_tax_uid": "source_tax_uid0", + "catalog_object_id": "catalog_object_id4", + "catalog_version": 106, + "name": "name2" + }, + { + "uid": "uid2", + "source_tax_uid": "source_tax_uid0", + "catalog_object_id": "catalog_object_id4", + "catalog_version": 106, + "name": "name2" + } + ] +} +``` + diff --git a/legacy/doc/models/order-reward.md b/legacy/doc/models/order-reward.md new file mode 100644 index 000000000..42d5b5b78 --- /dev/null +++ b/legacy/doc/models/order-reward.md @@ -0,0 +1,26 @@ + +# Order Reward + +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. + +## Structure + +`OrderReward` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string` | Required | The identifier of the reward.
**Constraints**: *Minimum Length*: `1` | +| `rewardTierId` | `string` | Required | The identifier of the reward tier corresponding to this reward.
**Constraints**: *Minimum Length*: `1` | + +## Example (as JSON) + +```json +{ + "id": "id0", + "reward_tier_id": "reward_tier_id6" +} +``` + diff --git a/legacy/doc/models/order-rounding-adjustment.md b/legacy/doc/models/order-rounding-adjustment.md new file mode 100644 index 000000000..60bee7237 --- /dev/null +++ b/legacy/doc/models/order-rounding-adjustment.md @@ -0,0 +1,31 @@ + +# Order Rounding Adjustment + +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. + +## Structure + +`OrderRoundingAdjustment` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string \| null \| undefined` | Optional | A unique ID that identifies the rounding adjustment only within this order.
**Constraints**: *Maximum Length*: `60` | +| `name` | `string \| null \| undefined` | Optional | The name of the rounding adjustment from the original sale order. | +| `amountMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "uid": "uid0", + "name": "name0", + "amount_money": { + "amount": 186, + "currency": "AUD" + } +} +``` + diff --git a/legacy/doc/models/order-service-charge-calculation-phase.md b/legacy/doc/models/order-service-charge-calculation-phase.md new file mode 100644 index 000000000..f1a054a91 --- /dev/null +++ b/legacy/doc/models/order-service-charge-calculation-phase.md @@ -0,0 +1,21 @@ + +# Order Service Charge Calculation Phase + +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) + +## Enumeration + +`OrderServiceChargeCalculationPhase` + +## Fields + +| Name | Description | +| --- | --- | +| `SUBTOTAL_PHASE` | The service charge is applied after discounts, but before
taxes. | +| `TOTAL_PHASE` | The service charge is applied after all discounts and taxes
are applied. | +| `APPORTIONED_PERCENTAGE_PHASE` | The service charge is calculated as a compounding adjustment
after any discounts, but before amount based apportioned service charges
and any tax considerations. | +| `APPORTIONED_AMOUNT_PHASE` | The service charge is calculated as a compounding adjustment
after any discounts and percentage based apportioned service charges,
but before any tax considerations. | + diff --git a/legacy/doc/models/order-service-charge-scope.md b/legacy/doc/models/order-service-charge-scope.md new file mode 100644 index 000000000..646680f47 --- /dev/null +++ b/legacy/doc/models/order-service-charge-scope.md @@ -0,0 +1,18 @@ + +# Order Service Charge Scope + +Indicates whether this is a line-item or order-level apportioned +service charge. + +## Enumeration + +`OrderServiceChargeScope` + +## Fields + +| Name | Description | +| --- | --- | +| `OTHER_SERVICE_CHARGE_SCOPE` | Used for reporting only.
The original transaction service charge scope is currently not supported by the API. | +| `LINE_ITEM` | The service charge should be applied to only line items specified by
`OrderLineItemAppliedServiceCharge` reference records. | +| `ORDER` | The service charge should be applied to the entire order. | + diff --git a/legacy/doc/models/order-service-charge-treatment-type.md b/legacy/doc/models/order-service-charge-treatment-type.md new file mode 100644 index 000000000..f54d58b58 --- /dev/null +++ b/legacy/doc/models/order-service-charge-treatment-type.md @@ -0,0 +1,17 @@ + +# Order Service Charge Treatment Type + +Indicates whether the service charge will be treated as a value-holding line item or +apportioned toward a line item. + +## Enumeration + +`OrderServiceChargeTreatmentType` + +## Fields + +| Name | +| --- | +| `LINE_ITEM_TREATMENT` | +| `APPORTIONED_TREATMENT` | + diff --git a/legacy/doc/models/order-service-charge-type.md b/legacy/doc/models/order-service-charge-type.md new file mode 100644 index 000000000..5c9f9159f --- /dev/null +++ b/legacy/doc/models/order-service-charge-type.md @@ -0,0 +1,14 @@ + +# Order Service Charge Type + +## Enumeration + +`OrderServiceChargeType` + +## Fields + +| Name | +| --- | +| `AUTO_GRATUITY` | +| `CUSTOM` | + diff --git a/legacy/doc/models/order-service-charge.md b/legacy/doc/models/order-service-charge.md new file mode 100644 index 000000000..ff791ce4f --- /dev/null +++ b/legacy/doc/models/order-service-charge.md @@ -0,0 +1,42 @@ + +# Order Service Charge + +Represents a service charge applied to an order. + +## Structure + +`OrderServiceCharge` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string \| null \| undefined` | Optional | A unique ID that identifies the service charge only within this order.
**Constraints**: *Maximum Length*: `60` | +| `name` | `string \| null \| undefined` | Optional | The name of the service charge.
**Constraints**: *Maximum Length*: `512` | +| `catalogObjectId` | `string \| null \| undefined` | Optional | The catalog object ID referencing the service charge [CatalogObject](entity:CatalogObject).
**Constraints**: *Maximum Length*: `192` | +| `catalogVersion` | `bigint \| null \| undefined` | Optional | The version of the catalog object that this service charge references. | +| `percentage` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `10` | +| `amountMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `appliedMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `totalMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `totalTaxMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `calculationPhase` | [`string \| undefined`](../../doc/models/order-service-charge-calculation-phase.md) | Optional | 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) | +| `taxable` | `boolean \| null \| undefined` | Optional | 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. | +| `appliedTaxes` | [`OrderLineItemAppliedTax[] \| null \| undefined`](../../doc/models/order-line-item-applied-tax.md) | Optional | 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` | `Record \| null \| undefined` | Optional | 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` | [`string \| undefined`](../../doc/models/order-service-charge-type.md) | Optional | - | +| `treatmentType` | [`string \| undefined`](../../doc/models/order-service-charge-treatment-type.md) | Optional | Indicates whether the service charge will be treated as a value-holding line item or
apportioned toward a line item. | +| `scope` | [`string \| undefined`](../../doc/models/order-service-charge-scope.md) | Optional | Indicates whether this is a line-item or order-level apportioned
service charge. | + +## Example (as JSON) + +```json +{ + "uid": "uid2", + "name": "name2", + "catalog_object_id": "catalog_object_id6", + "catalog_version": 104, + "percentage": "percentage0" +} +``` + diff --git a/legacy/doc/models/order-source.md b/legacy/doc/models/order-source.md new file mode 100644 index 000000000..1327450db --- /dev/null +++ b/legacy/doc/models/order-source.md @@ -0,0 +1,23 @@ + +# Order Source + +Represents the origination details of an order. + +## Structure + +`OrderSource` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `string \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "name": "name2" +} +``` + diff --git a/legacy/doc/models/order-state.md b/legacy/doc/models/order-state.md new file mode 100644 index 000000000..9cc35bf04 --- /dev/null +++ b/legacy/doc/models/order-state.md @@ -0,0 +1,18 @@ + +# Order State + +The state of the order. + +## Enumeration + +`OrderState` + +## Fields + +| Name | Description | +| --- | --- | +| `OPEN` | Indicates that the order is open. Open orders can be updated. | +| `COMPLETED` | Indicates that the order is completed. Completed orders are fully paid. This is a terminal state. | +| `CANCELED` | Indicates that the order is canceled. Canceled orders are not paid. This is a terminal state. | +| `DRAFT` | Indicates that the order is in a draft state. Draft orders can be updated,
but cannot be paid or fulfilled.
For more information, see [Create Orders](https://developer.squareup.com/docs/orders-api/create-orders). | + diff --git a/legacy/doc/models/order-updated-object.md b/legacy/doc/models/order-updated-object.md new file mode 100644 index 000000000..6bf44653c --- /dev/null +++ b/legacy/doc/models/order-updated-object.md @@ -0,0 +1,27 @@ + +# Order Updated Object + +## Structure + +`OrderUpdatedObject` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `orderUpdated` | [`OrderUpdated \| undefined`](../../doc/models/order-updated.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "order_updated": { + "order_id": "order_id6", + "version": 176, + "location_id": "location_id4", + "state": "OPEN", + "created_at": "created_at2" + } +} +``` + diff --git a/legacy/doc/models/order-updated.md b/legacy/doc/models/order-updated.md new file mode 100644 index 000000000..57faf7486 --- /dev/null +++ b/legacy/doc/models/order-updated.md @@ -0,0 +1,30 @@ + +# Order Updated + +## Structure + +`OrderUpdated` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `orderId` | `string \| null \| undefined` | Optional | The order's unique ID. | +| `version` | `number \| undefined` | Optional | 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) | +| `locationId` | `string \| null \| undefined` | Optional | The ID of the seller location that this order is associated with. | +| `state` | [`string \| undefined`](../../doc/models/order-state.md) | Optional | The state of the order. | +| `createdAt` | `string \| undefined` | Optional | The timestamp for when the order was created, in RFC 3339 format. | +| `updatedAt` | `string \| undefined` | Optional | The timestamp for when the order was last updated, in RFC 3339 format. | + +## Example (as JSON) + +```json +{ + "order_id": "order_id2", + "version": 162, + "location_id": "location_id2", + "state": "CANCELED", + "created_at": "created_at6" +} +``` + diff --git a/legacy/doc/models/order.md b/legacy/doc/models/order.md new file mode 100644 index 000000000..55f28a2c8 --- /dev/null +++ b/legacy/doc/models/order.md @@ -0,0 +1,88 @@ + +# Order + +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. + +## Structure + +`Order` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | The order's unique ID. | +| `locationId` | `string` | Required | The ID of the seller location that this order is associated with.
**Constraints**: *Minimum Length*: `1` | +| `referenceId` | `string \| null \| undefined` | Optional | A client-specified ID to associate an entity in another system
with this order.
**Constraints**: *Maximum Length*: `40` | +| `source` | [`OrderSource \| undefined`](../../doc/models/order-source.md) | Optional | Represents the origination details of an order. | +| `customerId` | `string \| null \| undefined` | Optional | The ID of the [customer](../../doc/models/customer.md) 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).
**Constraints**: *Maximum Length*: `191` | +| `lineItems` | [`OrderLineItem[] \| null \| undefined`](../../doc/models/order-line-item.md) | Optional | The line items included in the order. | +| `taxes` | [`OrderLineItemTax[] \| null \| undefined`](../../doc/models/order-line-item-tax.md) | Optional | 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` | [`OrderLineItemDiscount[] \| null \| undefined`](../../doc/models/order-line-item-discount.md) | Optional | 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. | +| `serviceCharges` | [`OrderServiceCharge[] \| null \| undefined`](../../doc/models/order-service-charge.md) | Optional | A list of service charges applied to the order. | +| `fulfillments` | [`Fulfillment[] \| null \| undefined`](../../doc/models/fulfillment.md) | Optional | 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` | [`OrderReturn[] \| undefined`](../../doc/models/order-return.md) | Optional | 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. | +| `returnAmounts` | [`OrderMoneyAmounts \| undefined`](../../doc/models/order-money-amounts.md) | Optional | A collection of various money amounts. | +| `netAmounts` | [`OrderMoneyAmounts \| undefined`](../../doc/models/order-money-amounts.md) | Optional | A collection of various money amounts. | +| `roundingAdjustment` | [`OrderRoundingAdjustment \| undefined`](../../doc/models/order-rounding-adjustment.md) | Optional | 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. | +| `tenders` | [`Tender[] \| undefined`](../../doc/models/tender.md) | Optional | The tenders that were used to pay for the order. | +| `refunds` | [`Refund[] \| undefined`](../../doc/models/refund.md) | Optional | The refunds that are part of this order. | +| `metadata` | `Record \| null \| undefined` | Optional | 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). | +| `createdAt` | `string \| undefined` | Optional | The timestamp for when the order was created, at server side, in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). | +| `updatedAt` | `string \| undefined` | Optional | The timestamp for when the order was last updated, at server side, in RFC 3339 format (for example, "2016-09-04T23:59:33.123Z"). | +| `closedAt` | `string \| undefined` | Optional | The timestamp for when the order reached a terminal [state](entity:OrderState), in RFC 3339 format (for example "2016-09-04T23:59:33.123Z"). | +| `state` | [`string \| undefined`](../../doc/models/order-state.md) | Optional | The state of the order. | +| `version` | `number \| undefined` | Optional | 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). | +| `totalMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `totalTaxMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `totalDiscountMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `totalTipMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `totalServiceChargeMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `ticketName` | `string \| null \| undefined` | Optional | A short-term identifier for the order (such as a customer first name,
table number, or auto-generated order number that resets daily).
**Constraints**: *Maximum Length*: `30` | +| `pricingOptions` | [`OrderPricingOptions \| undefined`](../../doc/models/order-pricing-options.md) | Optional | 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](../../doc/models/catalog-pricing-rule.md). | +| `rewards` | [`OrderReward[] \| undefined`](../../doc/models/order-reward.md) | Optional | A set-like list of Rewards that have been added to the Order. | +| `netAmountDueMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "id": "id2", + "location_id": "location_id6", + "reference_id": "reference_id0", + "source": { + "name": "name4" + }, + "customer_id": "customer_id0", + "line_items": [ + { + "uid": "uid8", + "name": "name8", + "quantity": "quantity4", + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note4", + "catalog_object_id": "catalog_object_id2" + } + ] +} +``` + diff --git a/legacy/doc/models/pagination-cursor.md b/legacy/doc/models/pagination-cursor.md new file mode 100644 index 000000000..21df01345 --- /dev/null +++ b/legacy/doc/models/pagination-cursor.md @@ -0,0 +1,24 @@ + +# Pagination Cursor + +Used *internally* to encapsulate pagination details. The resulting proto will be base62 encoded +in order to produce a cursor that can be used externally. + +## Structure + +`PaginationCursor` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `orderValue` | `string \| null \| undefined` | Optional | The ID of the last resource in the current page. The page can be in an ascending or
descending order | + +## Example (as JSON) + +```json +{ + "order_value": "order_value4" +} +``` + diff --git a/legacy/doc/models/pause-subscription-request.md b/legacy/doc/models/pause-subscription-request.md new file mode 100644 index 000000000..42eaf4d28 --- /dev/null +++ b/legacy/doc/models/pause-subscription-request.md @@ -0,0 +1,32 @@ + +# Pause Subscription Request + +Defines input parameters in a request to the +[PauseSubscription](../../doc/api/subscriptions.md#pause-subscription) endpoint. + +## Structure + +`PauseSubscriptionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `pauseEffectiveDate` | `string \| null \| undefined` | Optional | 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. | +| `pauseCycleDuration` | `bigint \| null \| undefined` | Optional | 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. | +| `resumeEffectiveDate` | `string \| null \| undefined` | Optional | 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`. | +| `resumeChangeTiming` | [`string \| undefined`](../../doc/models/change-timing.md) | Optional | Supported timings when a pending change, as an action, takes place to a subscription. | +| `pauseReason` | `string \| null \| undefined` | Optional | The user-provided reason to pause the subscription.
**Constraints**: *Maximum Length*: `255` | + +## Example (as JSON) + +```json +{ + "pause_effective_date": "pause_effective_date2", + "pause_cycle_duration": 98, + "resume_effective_date": "resume_effective_date0", + "resume_change_timing": "IMMEDIATE", + "pause_reason": "pause_reason6" +} +``` + diff --git a/legacy/doc/models/pause-subscription-response.md b/legacy/doc/models/pause-subscription-response.md new file mode 100644 index 000000000..0e86208a6 --- /dev/null +++ b/legacy/doc/models/pause-subscription-response.md @@ -0,0 +1,84 @@ + +# Pause Subscription Response + +Defines output parameters in a response from the +[PauseSubscription](../../doc/api/subscriptions.md#pause-subscription) endpoint. + +## Structure + +`PauseSubscriptionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Errors encountered during the request. | +| `subscription` | [`Subscription \| undefined`](../../doc/models/subscription.md) | Optional | Represents a subscription purchased by a customer.

For more information, see
[Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). | +| `actions` | [`SubscriptionAction[] \| undefined`](../../doc/models/subscription-action.md) | Optional | The list of a `PAUSE` action and a possible `RESUME` action created by the request. | + +## Example (as JSON) + +```json +{ + "actions": [ + { + "effective_date": "2023-11-17", + "id": "99b2439e-63f7-3ad5-95f7-ab2447a80673", + "type": "PAUSE", + "monthly_billing_anchor_date": 186, + "phases": [ + { + "uid": "uid0", + "ordinal": 78, + "order_template_id": "order_template_id2", + "plan_phase_uid": "plan_phase_uid6" + }, + { + "uid": "uid0", + "ordinal": 78, + "order_template_id": "order_template_id2", + "plan_phase_uid": "plan_phase_uid6" + }, + { + "uid": "uid0", + "ordinal": 78, + "order_template_id": "order_template_id2", + "plan_phase_uid": "plan_phase_uid6" + } + ] + } + ], + "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 + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/pay-order-request.md b/legacy/doc/models/pay-order-request.md new file mode 100644 index 000000000..491e5ed72 --- /dev/null +++ b/legacy/doc/models/pay-order-request.md @@ -0,0 +1,31 @@ + +# Pay Order Request + +Defines the fields that are included in requests to the +[PayOrder](../../doc/api/orders.md#pay-order) endpoint. + +## Structure + +`PayOrderRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string` | Required | 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).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `192` | +| `orderVersion` | `number \| null \| undefined` | Optional | The version of the order being paid. If not supplied, the latest version will be paid. | +| `paymentIds` | `string[] \| null \| undefined` | Optional | The IDs of the [payments](entity:Payment) to collect.
The payment total must match the order total. | + +## Example (as JSON) + +```json +{ + "idempotency_key": "c043a359-7ad9-4136-82a9-c3f1d66dcbff", + "payment_ids": [ + "EnZdNAlWCmfh6Mt5FMNST1o7taB", + "0LRiVlbXVwe8ozu4KbZxd12mvaB" + ], + "order_version": 102 +} +``` + diff --git a/legacy/doc/models/pay-order-response.md b/legacy/doc/models/pay-order-response.md new file mode 100644 index 000000000..6c6cac2cc --- /dev/null +++ b/legacy/doc/models/pay-order-response.md @@ -0,0 +1,226 @@ + +# Pay Order Response + +Defines the fields that are included in the response body of a request to the +[PayOrder](../../doc/api/orders.md#pay-order) endpoint. + +## Structure + +`PayOrderResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `order` | [`Order \| undefined`](../../doc/models/order.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "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", + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note4", + "catalog_object_id": "catalog_object_id2" + }, + { + "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", + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note4", + "catalog_object_id": "catalog_object_id2" + } + ], + "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, + "reference_id": "reference_id4", + "customer_id": "customer_id4" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/payment-balance-activity-app-fee-refund-detail.md b/legacy/doc/models/payment-balance-activity-app-fee-refund-detail.md new file mode 100644 index 000000000..945613e7a --- /dev/null +++ b/legacy/doc/models/payment-balance-activity-app-fee-refund-detail.md @@ -0,0 +1,25 @@ + +# Payment Balance Activity App Fee Refund Detail + +## Structure + +`PaymentBalanceActivityAppFeeRefundDetail` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `paymentId` | `string \| null \| undefined` | Optional | The ID of the payment associated with this activity. | +| `refundId` | `string \| null \| undefined` | Optional | The ID of the refund associated with this activity. | +| `locationId` | `string \| null \| undefined` | Optional | The ID of the location of the merchant associated with the payment refund activity | + +## Example (as JSON) + +```json +{ + "payment_id": "payment_id4", + "refund_id": "refund_id8", + "location_id": "location_id8" +} +``` + diff --git a/legacy/doc/models/payment-balance-activity-app-fee-revenue-detail.md b/legacy/doc/models/payment-balance-activity-app-fee-revenue-detail.md new file mode 100644 index 000000000..07dfa95a6 --- /dev/null +++ b/legacy/doc/models/payment-balance-activity-app-fee-revenue-detail.md @@ -0,0 +1,23 @@ + +# Payment Balance Activity App Fee Revenue Detail + +## Structure + +`PaymentBalanceActivityAppFeeRevenueDetail` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `paymentId` | `string \| null \| undefined` | Optional | The ID of the payment associated with this activity. | +| `locationId` | `string \| null \| undefined` | Optional | The ID of the location of the merchant associated with the payment activity | + +## Example (as JSON) + +```json +{ + "payment_id": "payment_id0", + "location_id": "location_id4" +} +``` + diff --git a/legacy/doc/models/payment-balance-activity-automatic-savings-detail.md b/legacy/doc/models/payment-balance-activity-automatic-savings-detail.md new file mode 100644 index 000000000..8aeb8d573 --- /dev/null +++ b/legacy/doc/models/payment-balance-activity-automatic-savings-detail.md @@ -0,0 +1,23 @@ + +# Payment Balance Activity Automatic Savings Detail + +## Structure + +`PaymentBalanceActivityAutomaticSavingsDetail` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `paymentId` | `string \| null \| undefined` | Optional | The ID of the payment associated with this activity. | +| `payoutId` | `string \| null \| undefined` | Optional | The ID of the payout associated with this activity. | + +## Example (as JSON) + +```json +{ + "payment_id": "payment_id4", + "payout_id": "payout_id0" +} +``` + diff --git a/legacy/doc/models/payment-balance-activity-automatic-savings-reversed-detail.md b/legacy/doc/models/payment-balance-activity-automatic-savings-reversed-detail.md new file mode 100644 index 000000000..82a0a9471 --- /dev/null +++ b/legacy/doc/models/payment-balance-activity-automatic-savings-reversed-detail.md @@ -0,0 +1,23 @@ + +# Payment Balance Activity Automatic Savings Reversed Detail + +## Structure + +`PaymentBalanceActivityAutomaticSavingsReversedDetail` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `paymentId` | `string \| null \| undefined` | Optional | The ID of the payment associated with this activity. | +| `payoutId` | `string \| null \| undefined` | Optional | The ID of the payout associated with this activity. | + +## Example (as JSON) + +```json +{ + "payment_id": "payment_id6", + "payout_id": "payout_id2" +} +``` + diff --git a/legacy/doc/models/payment-balance-activity-charge-detail.md b/legacy/doc/models/payment-balance-activity-charge-detail.md new file mode 100644 index 000000000..95c2fceb4 --- /dev/null +++ b/legacy/doc/models/payment-balance-activity-charge-detail.md @@ -0,0 +1,21 @@ + +# Payment Balance Activity Charge Detail + +## Structure + +`PaymentBalanceActivityChargeDetail` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `paymentId` | `string \| null \| undefined` | Optional | The ID of the payment associated with this activity. | + +## Example (as JSON) + +```json +{ + "payment_id": "payment_id2" +} +``` + diff --git a/legacy/doc/models/payment-balance-activity-deposit-fee-detail.md b/legacy/doc/models/payment-balance-activity-deposit-fee-detail.md new file mode 100644 index 000000000..6012f8b12 --- /dev/null +++ b/legacy/doc/models/payment-balance-activity-deposit-fee-detail.md @@ -0,0 +1,21 @@ + +# Payment Balance Activity Deposit Fee Detail + +## Structure + +`PaymentBalanceActivityDepositFeeDetail` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `payoutId` | `string \| null \| undefined` | Optional | The ID of the payout that triggered this deposit fee activity. | + +## Example (as JSON) + +```json +{ + "payout_id": "payout_id2" +} +``` + diff --git a/legacy/doc/models/payment-balance-activity-deposit-fee-reversed-detail.md b/legacy/doc/models/payment-balance-activity-deposit-fee-reversed-detail.md new file mode 100644 index 000000000..9957bd972 --- /dev/null +++ b/legacy/doc/models/payment-balance-activity-deposit-fee-reversed-detail.md @@ -0,0 +1,21 @@ + +# Payment Balance Activity Deposit Fee Reversed Detail + +## Structure + +`PaymentBalanceActivityDepositFeeReversedDetail` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `payoutId` | `string \| null \| undefined` | Optional | The ID of the payout that triggered this deposit fee activity. | + +## Example (as JSON) + +```json +{ + "payout_id": "payout_id6" +} +``` + diff --git a/legacy/doc/models/payment-balance-activity-dispute-detail.md b/legacy/doc/models/payment-balance-activity-dispute-detail.md new file mode 100644 index 000000000..3ecbac92b --- /dev/null +++ b/legacy/doc/models/payment-balance-activity-dispute-detail.md @@ -0,0 +1,23 @@ + +# Payment Balance Activity Dispute Detail + +## Structure + +`PaymentBalanceActivityDisputeDetail` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `paymentId` | `string \| null \| undefined` | Optional | The ID of the payment associated with this activity. | +| `disputeId` | `string \| null \| undefined` | Optional | The ID of the dispute associated with this activity. | + +## Example (as JSON) + +```json +{ + "payment_id": "payment_id2", + "dispute_id": "dispute_id4" +} +``` + diff --git a/legacy/doc/models/payment-balance-activity-fee-detail.md b/legacy/doc/models/payment-balance-activity-fee-detail.md new file mode 100644 index 000000000..7a1d1a32d --- /dev/null +++ b/legacy/doc/models/payment-balance-activity-fee-detail.md @@ -0,0 +1,21 @@ + +# Payment Balance Activity Fee Detail + +## Structure + +`PaymentBalanceActivityFeeDetail` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `paymentId` | `string \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "payment_id": "payment_id2" +} +``` + diff --git a/legacy/doc/models/payment-balance-activity-free-processing-detail.md b/legacy/doc/models/payment-balance-activity-free-processing-detail.md new file mode 100644 index 000000000..25c6e276e --- /dev/null +++ b/legacy/doc/models/payment-balance-activity-free-processing-detail.md @@ -0,0 +1,21 @@ + +# Payment Balance Activity Free Processing Detail + +## Structure + +`PaymentBalanceActivityFreeProcessingDetail` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `paymentId` | `string \| null \| undefined` | Optional | The ID of the payment associated with this activity. | + +## Example (as JSON) + +```json +{ + "payment_id": "payment_id8" +} +``` + diff --git a/legacy/doc/models/payment-balance-activity-hold-adjustment-detail.md b/legacy/doc/models/payment-balance-activity-hold-adjustment-detail.md new file mode 100644 index 000000000..4f34a3446 --- /dev/null +++ b/legacy/doc/models/payment-balance-activity-hold-adjustment-detail.md @@ -0,0 +1,21 @@ + +# Payment Balance Activity Hold Adjustment Detail + +## Structure + +`PaymentBalanceActivityHoldAdjustmentDetail` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `paymentId` | `string \| null \| undefined` | Optional | The ID of the payment associated with this activity. | + +## Example (as JSON) + +```json +{ + "payment_id": "payment_id6" +} +``` + diff --git a/legacy/doc/models/payment-balance-activity-open-dispute-detail.md b/legacy/doc/models/payment-balance-activity-open-dispute-detail.md new file mode 100644 index 000000000..365fb6da7 --- /dev/null +++ b/legacy/doc/models/payment-balance-activity-open-dispute-detail.md @@ -0,0 +1,23 @@ + +# Payment Balance Activity Open Dispute Detail + +## Structure + +`PaymentBalanceActivityOpenDisputeDetail` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `paymentId` | `string \| null \| undefined` | Optional | The ID of the payment associated with this activity. | +| `disputeId` | `string \| null \| undefined` | Optional | The ID of the dispute associated with this activity. | + +## Example (as JSON) + +```json +{ + "payment_id": "payment_id6", + "dispute_id": "dispute_id8" +} +``` + diff --git a/legacy/doc/models/payment-balance-activity-other-adjustment-detail.md b/legacy/doc/models/payment-balance-activity-other-adjustment-detail.md new file mode 100644 index 000000000..bab5cd90b --- /dev/null +++ b/legacy/doc/models/payment-balance-activity-other-adjustment-detail.md @@ -0,0 +1,21 @@ + +# Payment Balance Activity Other Adjustment Detail + +## Structure + +`PaymentBalanceActivityOtherAdjustmentDetail` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `paymentId` | `string \| null \| undefined` | Optional | The ID of the payment associated with this activity. | + +## Example (as JSON) + +```json +{ + "payment_id": "payment_id4" +} +``` + diff --git a/legacy/doc/models/payment-balance-activity-other-detail.md b/legacy/doc/models/payment-balance-activity-other-detail.md new file mode 100644 index 000000000..780ccde44 --- /dev/null +++ b/legacy/doc/models/payment-balance-activity-other-detail.md @@ -0,0 +1,21 @@ + +# Payment Balance Activity Other Detail + +## Structure + +`PaymentBalanceActivityOtherDetail` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `paymentId` | `string \| null \| undefined` | Optional | The ID of the payment associated with this activity. | + +## Example (as JSON) + +```json +{ + "payment_id": "payment_id4" +} +``` + diff --git a/legacy/doc/models/payment-balance-activity-refund-detail.md b/legacy/doc/models/payment-balance-activity-refund-detail.md new file mode 100644 index 000000000..313751470 --- /dev/null +++ b/legacy/doc/models/payment-balance-activity-refund-detail.md @@ -0,0 +1,23 @@ + +# Payment Balance Activity Refund Detail + +## Structure + +`PaymentBalanceActivityRefundDetail` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `paymentId` | `string \| null \| undefined` | Optional | The ID of the payment associated with this activity. | +| `refundId` | `string \| null \| undefined` | Optional | The ID of the refund associated with this activity. | + +## Example (as JSON) + +```json +{ + "payment_id": "payment_id6", + "refund_id": "refund_id0" +} +``` + diff --git a/legacy/doc/models/payment-balance-activity-release-adjustment-detail.md b/legacy/doc/models/payment-balance-activity-release-adjustment-detail.md new file mode 100644 index 000000000..eed1ef79e --- /dev/null +++ b/legacy/doc/models/payment-balance-activity-release-adjustment-detail.md @@ -0,0 +1,21 @@ + +# Payment Balance Activity Release Adjustment Detail + +## Structure + +`PaymentBalanceActivityReleaseAdjustmentDetail` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `paymentId` | `string \| null \| undefined` | Optional | The ID of the payment associated with this activity. | + +## Example (as JSON) + +```json +{ + "payment_id": "payment_id0" +} +``` + diff --git a/legacy/doc/models/payment-balance-activity-reserve-hold-detail.md b/legacy/doc/models/payment-balance-activity-reserve-hold-detail.md new file mode 100644 index 000000000..63bb82632 --- /dev/null +++ b/legacy/doc/models/payment-balance-activity-reserve-hold-detail.md @@ -0,0 +1,21 @@ + +# Payment Balance Activity Reserve Hold Detail + +## Structure + +`PaymentBalanceActivityReserveHoldDetail` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `paymentId` | `string \| null \| undefined` | Optional | The ID of the payment associated with this activity. | + +## Example (as JSON) + +```json +{ + "payment_id": "payment_id8" +} +``` + diff --git a/legacy/doc/models/payment-balance-activity-reserve-release-detail.md b/legacy/doc/models/payment-balance-activity-reserve-release-detail.md new file mode 100644 index 000000000..2efd90567 --- /dev/null +++ b/legacy/doc/models/payment-balance-activity-reserve-release-detail.md @@ -0,0 +1,21 @@ + +# Payment Balance Activity Reserve Release Detail + +## Structure + +`PaymentBalanceActivityReserveReleaseDetail` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `paymentId` | `string \| null \| undefined` | Optional | The ID of the payment associated with this activity. | + +## Example (as JSON) + +```json +{ + "payment_id": "payment_id6" +} +``` + diff --git a/legacy/doc/models/payment-balance-activity-square-capital-payment-detail.md b/legacy/doc/models/payment-balance-activity-square-capital-payment-detail.md new file mode 100644 index 000000000..b7fb83b8c --- /dev/null +++ b/legacy/doc/models/payment-balance-activity-square-capital-payment-detail.md @@ -0,0 +1,21 @@ + +# Payment Balance Activity Square Capital Payment Detail + +## Structure + +`PaymentBalanceActivitySquareCapitalPaymentDetail` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `paymentId` | `string \| null \| undefined` | Optional | The ID of the payment associated with this activity. | + +## Example (as JSON) + +```json +{ + "payment_id": "payment_id6" +} +``` + diff --git a/legacy/doc/models/payment-balance-activity-square-capital-reversed-payment-detail.md b/legacy/doc/models/payment-balance-activity-square-capital-reversed-payment-detail.md new file mode 100644 index 000000000..d873bed5a --- /dev/null +++ b/legacy/doc/models/payment-balance-activity-square-capital-reversed-payment-detail.md @@ -0,0 +1,21 @@ + +# Payment Balance Activity Square Capital Reversed Payment Detail + +## Structure + +`PaymentBalanceActivitySquareCapitalReversedPaymentDetail` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `paymentId` | `string \| null \| undefined` | Optional | The ID of the payment associated with this activity. | + +## Example (as JSON) + +```json +{ + "payment_id": "payment_id8" +} +``` + diff --git a/legacy/doc/models/payment-balance-activity-square-payroll-transfer-detail.md b/legacy/doc/models/payment-balance-activity-square-payroll-transfer-detail.md new file mode 100644 index 000000000..32a1a7dc9 --- /dev/null +++ b/legacy/doc/models/payment-balance-activity-square-payroll-transfer-detail.md @@ -0,0 +1,21 @@ + +# Payment Balance Activity Square Payroll Transfer Detail + +## Structure + +`PaymentBalanceActivitySquarePayrollTransferDetail` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `paymentId` | `string \| null \| undefined` | Optional | The ID of the payment associated with this activity. | + +## Example (as JSON) + +```json +{ + "payment_id": "payment_id0" +} +``` + diff --git a/legacy/doc/models/payment-balance-activity-square-payroll-transfer-reversed-detail.md b/legacy/doc/models/payment-balance-activity-square-payroll-transfer-reversed-detail.md new file mode 100644 index 000000000..18bb6d83b --- /dev/null +++ b/legacy/doc/models/payment-balance-activity-square-payroll-transfer-reversed-detail.md @@ -0,0 +1,21 @@ + +# Payment Balance Activity Square Payroll Transfer Reversed Detail + +## Structure + +`PaymentBalanceActivitySquarePayrollTransferReversedDetail` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `paymentId` | `string \| null \| undefined` | Optional | The ID of the payment associated with this activity. | + +## Example (as JSON) + +```json +{ + "payment_id": "payment_id6" +} +``` + diff --git a/legacy/doc/models/payment-balance-activity-tax-on-fee-detail.md b/legacy/doc/models/payment-balance-activity-tax-on-fee-detail.md new file mode 100644 index 000000000..f081b232c --- /dev/null +++ b/legacy/doc/models/payment-balance-activity-tax-on-fee-detail.md @@ -0,0 +1,23 @@ + +# Payment Balance Activity Tax on Fee Detail + +## Structure + +`PaymentBalanceActivityTaxOnFeeDetail` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `paymentId` | `string \| null \| undefined` | Optional | The ID of the payment associated with this activity. | +| `taxRateDescription` | `string \| null \| undefined` | Optional | The description of the tax rate being applied. For example: "GST", "HST". | + +## Example (as JSON) + +```json +{ + "payment_id": "payment_id0", + "tax_rate_description": "tax_rate_description8" +} +``` + diff --git a/legacy/doc/models/payment-balance-activity-third-party-fee-detail.md b/legacy/doc/models/payment-balance-activity-third-party-fee-detail.md new file mode 100644 index 000000000..e148d00dc --- /dev/null +++ b/legacy/doc/models/payment-balance-activity-third-party-fee-detail.md @@ -0,0 +1,21 @@ + +# Payment Balance Activity Third Party Fee Detail + +## Structure + +`PaymentBalanceActivityThirdPartyFeeDetail` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `paymentId` | `string \| null \| undefined` | Optional | The ID of the payment associated with this activity. | + +## Example (as JSON) + +```json +{ + "payment_id": "payment_id8" +} +``` + diff --git a/legacy/doc/models/payment-balance-activity-third-party-fee-refund-detail.md b/legacy/doc/models/payment-balance-activity-third-party-fee-refund-detail.md new file mode 100644 index 000000000..21e137e80 --- /dev/null +++ b/legacy/doc/models/payment-balance-activity-third-party-fee-refund-detail.md @@ -0,0 +1,23 @@ + +# Payment Balance Activity Third Party Fee Refund Detail + +## Structure + +`PaymentBalanceActivityThirdPartyFeeRefundDetail` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `paymentId` | `string \| null \| undefined` | Optional | The ID of the payment associated with this activity. | +| `refundId` | `string \| null \| undefined` | Optional | The public refund id associated with this activity. | + +## Example (as JSON) + +```json +{ + "payment_id": "payment_id6", + "refund_id": "refund_id0" +} +``` + diff --git a/legacy/doc/models/payment-link-related-resources.md b/legacy/doc/models/payment-link-related-resources.md new file mode 100644 index 000000000..b7103d3b5 --- /dev/null +++ b/legacy/doc/models/payment-link-related-resources.md @@ -0,0 +1,223 @@ + +# Payment Link Related Resources + +## Structure + +`PaymentLinkRelatedResources` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `orders` | [`Order[] \| null \| undefined`](../../doc/models/order.md) | Optional | The order associated with the payment link. | +| `subscriptionPlans` | [`CatalogObject[] \| null \| undefined`](../../doc/models/catalog-object.md) | Optional | The subscription plan associated with the payment link. | + +## Example (as JSON) + +```json +{ + "orders": [ + { + "id": "id2", + "location_id": "location_id6", + "reference_id": "reference_id0", + "source": { + "name": "name4" + }, + "customer_id": "customer_id0", + "line_items": [ + { + "uid": "uid8", + "name": "name8", + "quantity": "quantity4", + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note4", + "catalog_object_id": "catalog_object_id2" + }, + { + "uid": "uid8", + "name": "name8", + "quantity": "quantity4", + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note4", + "catalog_object_id": "catalog_object_id2" + } + ] + }, + { + "id": "id2", + "location_id": "location_id6", + "reference_id": "reference_id0", + "source": { + "name": "name4" + }, + "customer_id": "customer_id0", + "line_items": [ + { + "uid": "uid8", + "name": "name8", + "quantity": "quantity4", + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note4", + "catalog_object_id": "catalog_object_id2" + }, + { + "uid": "uid8", + "name": "name8", + "quantity": "quantity4", + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note4", + "catalog_object_id": "catalog_object_id2" + } + ] + } + ], + "subscription_plans": [ + { + "type": "ITEM_OPTION", + "id": "id4", + "updated_at": "updated_at0", + "version": 112, + "is_deleted": false, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key2": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] + }, + { + "type": "ITEM_OPTION", + "id": "id4", + "updated_at": "updated_at0", + "version": 112, + "is_deleted": false, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key2": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] + } + ] +} +``` + diff --git a/legacy/doc/models/payment-link.md b/legacy/doc/models/payment-link.md new file mode 100644 index 000000000..84dcfe16e --- /dev/null +++ b/legacy/doc/models/payment-link.md @@ -0,0 +1,59 @@ + +# Payment Link + +## Structure + +`PaymentLink` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | The Square-assigned ID of the payment link. | +| `version` | `number` | Required | The Square-assigned version number, which is incremented each time an update is committed to the payment link.
**Constraints**: `<= 65535` | +| `description` | `string \| null \| undefined` | Optional | The optional description of the `payment_link` object.
It is primarily for use by your application and is not used anywhere.
**Constraints**: *Maximum Length*: `4096` | +| `orderId` | `string \| undefined` | Optional | The ID of the order associated with the payment link.
**Constraints**: *Maximum Length*: `192` | +| `checkoutOptions` | [`CheckoutOptions \| undefined`](../../doc/models/checkout-options.md) | Optional | - | +| `prePopulatedData` | [`PrePopulatedData \| undefined`](../../doc/models/pre-populated-data.md) | Optional | 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). | +| `url` | `string \| undefined` | Optional | The shortened URL of the payment link.
**Constraints**: *Maximum Length*: `255` | +| `longUrl` | `string \| undefined` | Optional | The long URL of the payment link.
**Constraints**: *Maximum Length*: `255` | +| `createdAt` | `string \| undefined` | Optional | The timestamp when the payment link was created, in RFC 3339 format. | +| `updatedAt` | `string \| undefined` | Optional | The timestamp when the payment link was last updated, in RFC 3339 format. | +| `paymentNote` | `string \| null \| undefined` | Optional | An optional note. After Square processes the payment, this note is added to the
resulting `Payment`.
**Constraints**: *Maximum Length*: `500` | + +## Example (as JSON) + +```json +{ + "id": "id2", + "version": 64, + "description": "description8", + "order_id": "order_id4", + "checkout_options": { + "allow_tipping": false, + "custom_fields": [ + { + "title": "title8" + }, + { + "title": "title8" + } + ], + "subscription_plan_id": "subscription_plan_id8", + "redirect_url": "redirect_url2", + "merchant_support_email": "merchant_support_email8" + }, + "pre_populated_data": { + "buyer_email": "buyer_email8", + "buyer_phone_number": "buyer_phone_number0", + "buyer_address": { + "address_line_1": "address_line_12", + "address_line_2": "address_line_22", + "address_line_3": "address_line_38", + "locality": "locality2", + "sublocality": "sublocality2" + } + } +} +``` + diff --git a/legacy/doc/models/payment-options-delay-action.md b/legacy/doc/models/payment-options-delay-action.md new file mode 100644 index 000000000..447fa0c11 --- /dev/null +++ b/legacy/doc/models/payment-options-delay-action.md @@ -0,0 +1,17 @@ + +# Payment Options Delay Action + +Describes the action to be applied to a delayed capture payment when the delay_duration +has elapsed. + +## Enumeration + +`PaymentOptionsDelayAction` + +## Fields + +| Name | Description | +| --- | --- | +| `CANCEL` | Indicates that the payment should be automatically canceled when the delay duration
elapses. | +| `COMPLETE` | Indicates that the payment should be automatically completed when the delay duration
elapses. | + diff --git a/legacy/doc/models/payment-options.md b/legacy/doc/models/payment-options.md new file mode 100644 index 000000000..816f2f825 --- /dev/null +++ b/legacy/doc/models/payment-options.md @@ -0,0 +1,27 @@ + +# Payment Options + +## Structure + +`PaymentOptions` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `autocomplete` | `boolean \| null \| undefined` | Optional | Indicates whether the `Payment` objects created from this `TerminalCheckout` are automatically
`COMPLETED` or left in an `APPROVED` state for later modification. | +| `delayDuration` | `string \| null \| undefined` | Optional | The duration of time after the payment's creation when Square automatically cancels the
payment. This automatic cancellation applies only to payments that do not reach a terminal state
(COMPLETED 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.

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. | +| `acceptPartialAuthorization` | `boolean \| null \| undefined` | Optional | 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`.
This field cannot be `true` when an `order_id` isn't specified.

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 | +| `delayAction` | [`string \| undefined`](../../doc/models/payment-options-delay-action.md) | Optional | Describes the action to be applied to a delayed capture payment when the delay_duration
has elapsed. | + +## Example (as JSON) + +```json +{ + "autocomplete": false, + "delay_duration": "delay_duration8", + "accept_partial_authorization": false, + "delay_action": "CANCEL" +} +``` + diff --git a/legacy/doc/models/payment-refund.md b/legacy/doc/models/payment-refund.md new file mode 100644 index 000000000..8be0d8b46 --- /dev/null +++ b/legacy/doc/models/payment-refund.md @@ -0,0 +1,75 @@ + +# Payment Refund + +Represents a refund of a payment made using Square. Contains information about +the original payment and the amount of money refunded. + +## Structure + +`PaymentRefund` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string` | Required | The unique ID for this refund, generated by Square.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | +| `status` | `string \| null \| undefined` | Optional | The refund's status:

- `PENDING` - Awaiting approval.
- `COMPLETED` - Successfully completed.
- `REJECTED` - The refund was rejected.
- `FAILED` - An error occurred.
**Constraints**: *Maximum Length*: `50` | +| `locationId` | `string \| null \| undefined` | Optional | The location ID associated with the payment this refund is attached to.
**Constraints**: *Maximum Length*: `50` | +| `unlinked` | `boolean \| undefined` | Optional | Flag indicating whether or not the refund is linked to an existing payment in Square. | +| `destinationType` | `string \| null \| undefined` | Optional | The destination type for this refund.

Current values include `CARD`, `BANK_ACCOUNT`, `WALLET`, `BUY_NOW_PAY_LATER`, `CASH`,
`EXTERNAL`, and `SQUARE_ACCOUNT`.
**Constraints**: *Maximum Length*: `50` | +| `destinationDetails` | [`DestinationDetails \| undefined`](../../doc/models/destination-details.md) | Optional | Details about a refund's destination. | +| `amountMoney` | [`Money`](../../doc/models/money.md) | Required | 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. | +| `appFeeMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `processingFee` | [`ProcessingFee[] \| null \| undefined`](../../doc/models/processing-fee.md) | Optional | Processing fees and fee adjustments assessed by Square for this refund. | +| `paymentId` | `string \| null \| undefined` | Optional | The ID of the payment associated with this refund.
**Constraints**: *Maximum Length*: `192` | +| `orderId` | `string \| null \| undefined` | Optional | The ID of the order associated with the refund.
**Constraints**: *Maximum Length*: `192` | +| `reason` | `string \| null \| undefined` | Optional | The reason for the refund.
**Constraints**: *Maximum Length*: `192` | +| `createdAt` | `string \| undefined` | Optional | The timestamp of when the refund was created, in RFC 3339 format.
**Constraints**: *Maximum Length*: `32` | +| `updatedAt` | `string \| undefined` | Optional | The timestamp of when the refund was last updated, in RFC 3339 format.
**Constraints**: *Maximum Length*: `32` | +| `teamMemberId` | `string \| undefined` | Optional | An optional ID of the team member associated with taking the payment.
**Constraints**: *Maximum Length*: `192` | +| `terminalRefundId` | `string \| undefined` | Optional | An optional ID for a Terminal refund. | + +## Example (as JSON) + +```json +{ + "id": "id4", + "status": "status6", + "location_id": "location_id8", + "unlinked": false, + "destination_type": "destination_type8", + "destination_details": { + "card_details": { + "card": { + "id": "id6", + "card_brand": "OTHER_BRAND", + "last_4": "last_48", + "exp_month": 228, + "exp_year": 68 + }, + "entry_method": "entry_method8", + "auth_result_code": "auth_result_code0" + }, + "cash_details": { + "seller_supplied_money": { + "amount": 36, + "currency": "MKD" + }, + "change_back_money": { + "amount": 78, + "currency": "XBD" + } + }, + "external_details": { + "type": "type6", + "source": "source0", + "source_id": "source_id8" + } + }, + "amount_money": { + "amount": 186, + "currency": "AUD" + } +} +``` + diff --git a/legacy/doc/models/payment-sort-field.md b/legacy/doc/models/payment-sort-field.md new file mode 100644 index 000000000..4fe5d19e2 --- /dev/null +++ b/legacy/doc/models/payment-sort-field.md @@ -0,0 +1,15 @@ + +# Payment Sort Field + +## Enumeration + +`PaymentSortField` + +## Fields + +| Name | +| --- | +| `CREATED_AT` | +| `OFFLINE_CREATED_AT` | +| `UPDATED_AT` | + diff --git a/legacy/doc/models/payment.md b/legacy/doc/models/payment.md new file mode 100644 index 000000000..ba40bcec2 --- /dev/null +++ b/legacy/doc/models/payment.md @@ -0,0 +1,76 @@ + +# Payment + +Represents a payment processed by the Square API. + +## Structure + +`Payment` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | A unique ID for the payment.
**Constraints**: *Maximum Length*: `192` | +| `createdAt` | `string \| undefined` | Optional | The timestamp of when the payment was created, in RFC 3339 format.
**Constraints**: *Maximum Length*: `32` | +| `updatedAt` | `string \| undefined` | Optional | The timestamp of when the payment was last updated, in RFC 3339 format.
**Constraints**: *Maximum Length*: `32` | +| `amountMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `tipMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `totalMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `appFeeMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `approvedMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `processingFee` | [`ProcessingFee[] \| undefined`](../../doc/models/processing-fee.md) | Optional | The processing fees and fee adjustments assessed by Square for this payment. | +| `refundedMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `status` | `string \| undefined` | Optional | Indicates whether the payment is APPROVED, PENDING, COMPLETED, CANCELED, or FAILED.
**Constraints**: *Maximum Length*: `50` | +| `delayDuration` | `string \| undefined` | Optional | 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. | +| `delayAction` | `string \| null \| undefined` | Optional | The action to be applied to the payment when the `delay_duration` has elapsed.

Current values include `CANCEL` and `COMPLETE`. | +| `delayedUntil` | `string \| undefined` | Optional | 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. | +| `sourceType` | `string \| undefined` | Optional | 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).
**Constraints**: *Maximum Length*: `50` | +| `cardDetails` | [`CardPaymentDetails \| undefined`](../../doc/models/card-payment-details.md) | Optional | Reflects the current status of a card payment. Contains only non-confidential information. | +| `cashDetails` | [`CashPaymentDetails \| undefined`](../../doc/models/cash-payment-details.md) | Optional | 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). | +| `bankAccountDetails` | [`BankAccountPaymentDetails \| undefined`](../../doc/models/bank-account-payment-details.md) | Optional | Additional details about BANK_ACCOUNT type payments. | +| `externalDetails` | [`ExternalPaymentDetails \| undefined`](../../doc/models/external-payment-details.md) | Optional | 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). | +| `walletDetails` | [`DigitalWalletDetails \| undefined`](../../doc/models/digital-wallet-details.md) | Optional | Additional details about `WALLET` type payments. Contains only non-confidential information. | +| `buyNowPayLaterDetails` | [`BuyNowPayLaterDetails \| undefined`](../../doc/models/buy-now-pay-later-details.md) | Optional | Additional details about a Buy Now Pay Later payment type. | +| `squareAccountDetails` | [`SquareAccountDetails \| undefined`](../../doc/models/square-account-details.md) | Optional | Additional details about Square Account payments. | +| `locationId` | `string \| undefined` | Optional | The ID of the location associated with the payment.
**Constraints**: *Maximum Length*: `50` | +| `orderId` | `string \| undefined` | Optional | The ID of the order associated with the payment.
**Constraints**: *Maximum Length*: `192` | +| `referenceId` | `string \| undefined` | Optional | An optional ID that associates the payment with an entity in
another system.
**Constraints**: *Maximum Length*: `40` | +| `customerId` | `string \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `191` | +| `employeeId` | `string \| undefined` | Optional | __Deprecated__: Use `Payment.team_member_id` instead.

An optional ID of the employee associated with taking the payment.
**Constraints**: *Maximum Length*: `192` | +| `teamMemberId` | `string \| null \| undefined` | Optional | An optional ID of the [TeamMember](entity:TeamMember) associated with taking the payment.
**Constraints**: *Maximum Length*: `192` | +| `refundIds` | `string[] \| undefined` | Optional | A list of `refund_id`s identifying refunds for the payment. | +| `riskEvaluation` | [`RiskEvaluation \| undefined`](../../doc/models/risk-evaluation.md) | Optional | 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). | +| `terminalCheckoutId` | `string \| undefined` | Optional | An optional ID for a Terminal checkout that is associated with the payment. | +| `buyerEmailAddress` | `string \| undefined` | Optional | The buyer's email address.
**Constraints**: *Maximum Length*: `255` | +| `billingAddress` | [`Address \| undefined`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | +| `shippingAddress` | [`Address \| undefined`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | +| `note` | `string \| undefined` | Optional | An optional note to include when creating a payment.
**Constraints**: *Maximum Length*: `500` | +| `statementDescriptionIdentifier` | `string \| undefined` | Optional | 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. | +| `capabilities` | `string[] \| undefined` | Optional | 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. | +| `receiptNumber` | `string \| undefined` | Optional | The payment's receipt number.
The field is missing if a payment is canceled.
**Constraints**: *Maximum Length*: `4` | +| `receiptUrl` | `string \| undefined` | Optional | The URL for the payment's receipt.
The field is only populated for COMPLETED payments.
**Constraints**: *Maximum Length*: `255` | +| `deviceDetails` | [`DeviceDetails \| undefined`](../../doc/models/device-details.md) | Optional | Details about the device that took the payment. | +| `applicationDetails` | [`ApplicationDetails \| undefined`](../../doc/models/application-details.md) | Optional | Details about the application that took the payment. | +| `isOfflinePayment` | `boolean \| undefined` | Optional | Whether or not this payment was taken offline. | +| `offlinePaymentDetails` | [`OfflinePaymentDetails \| undefined`](../../doc/models/offline-payment-details.md) | Optional | Details specific to offline payments. | +| `versionToken` | `string \| null \| undefined` | Optional | Used for optimistic concurrency. This opaque token identifies a specific version of the
`Payment` object. | + +## Example (as JSON) + +```json +{ + "id": "id8", + "created_at": "created_at6", + "updated_at": "updated_at4", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "tip_money": { + "amount": 190, + "currency": "TWD" + } +} +``` + diff --git a/legacy/doc/models/payout-entry.md b/legacy/doc/models/payout-entry.md new file mode 100644 index 000000000..1b4595b33 --- /dev/null +++ b/legacy/doc/models/payout-entry.md @@ -0,0 +1,70 @@ + +# Payout Entry + +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 + +## Structure + +`PayoutEntry` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string` | Required | A unique ID for the payout entry.
**Constraints**: *Minimum Length*: `1` | +| `payoutId` | `string` | Required | The ID of the payout entries’ associated payout.
**Constraints**: *Minimum Length*: `1` | +| `effectiveAt` | `string \| null \| undefined` | Optional | The timestamp of when the payout entry affected the balance, in RFC 3339 format. | +| `type` | [`string \| undefined`](../../doc/models/activity-type.md) | Optional | - | +| `grossAmountMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `feeAmountMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `netAmountMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `typeAppFeeRevenueDetails` | [`PaymentBalanceActivityAppFeeRevenueDetail \| undefined`](../../doc/models/payment-balance-activity-app-fee-revenue-detail.md) | Optional | - | +| `typeAppFeeRefundDetails` | [`PaymentBalanceActivityAppFeeRefundDetail \| undefined`](../../doc/models/payment-balance-activity-app-fee-refund-detail.md) | Optional | - | +| `typeAutomaticSavingsDetails` | [`PaymentBalanceActivityAutomaticSavingsDetail \| undefined`](../../doc/models/payment-balance-activity-automatic-savings-detail.md) | Optional | - | +| `typeAutomaticSavingsReversedDetails` | [`PaymentBalanceActivityAutomaticSavingsReversedDetail \| undefined`](../../doc/models/payment-balance-activity-automatic-savings-reversed-detail.md) | Optional | - | +| `typeChargeDetails` | [`PaymentBalanceActivityChargeDetail \| undefined`](../../doc/models/payment-balance-activity-charge-detail.md) | Optional | - | +| `typeDepositFeeDetails` | [`PaymentBalanceActivityDepositFeeDetail \| undefined`](../../doc/models/payment-balance-activity-deposit-fee-detail.md) | Optional | - | +| `typeDepositFeeReversedDetails` | [`PaymentBalanceActivityDepositFeeReversedDetail \| undefined`](../../doc/models/payment-balance-activity-deposit-fee-reversed-detail.md) | Optional | - | +| `typeDisputeDetails` | [`PaymentBalanceActivityDisputeDetail \| undefined`](../../doc/models/payment-balance-activity-dispute-detail.md) | Optional | - | +| `typeFeeDetails` | [`PaymentBalanceActivityFeeDetail \| undefined`](../../doc/models/payment-balance-activity-fee-detail.md) | Optional | - | +| `typeFreeProcessingDetails` | [`PaymentBalanceActivityFreeProcessingDetail \| undefined`](../../doc/models/payment-balance-activity-free-processing-detail.md) | Optional | - | +| `typeHoldAdjustmentDetails` | [`PaymentBalanceActivityHoldAdjustmentDetail \| undefined`](../../doc/models/payment-balance-activity-hold-adjustment-detail.md) | Optional | - | +| `typeOpenDisputeDetails` | [`PaymentBalanceActivityOpenDisputeDetail \| undefined`](../../doc/models/payment-balance-activity-open-dispute-detail.md) | Optional | - | +| `typeOtherDetails` | [`PaymentBalanceActivityOtherDetail \| undefined`](../../doc/models/payment-balance-activity-other-detail.md) | Optional | - | +| `typeOtherAdjustmentDetails` | [`PaymentBalanceActivityOtherAdjustmentDetail \| undefined`](../../doc/models/payment-balance-activity-other-adjustment-detail.md) | Optional | - | +| `typeRefundDetails` | [`PaymentBalanceActivityRefundDetail \| undefined`](../../doc/models/payment-balance-activity-refund-detail.md) | Optional | - | +| `typeReleaseAdjustmentDetails` | [`PaymentBalanceActivityReleaseAdjustmentDetail \| undefined`](../../doc/models/payment-balance-activity-release-adjustment-detail.md) | Optional | - | +| `typeReserveHoldDetails` | [`PaymentBalanceActivityReserveHoldDetail \| undefined`](../../doc/models/payment-balance-activity-reserve-hold-detail.md) | Optional | - | +| `typeReserveReleaseDetails` | [`PaymentBalanceActivityReserveReleaseDetail \| undefined`](../../doc/models/payment-balance-activity-reserve-release-detail.md) | Optional | - | +| `typeSquareCapitalPaymentDetails` | [`PaymentBalanceActivitySquareCapitalPaymentDetail \| undefined`](../../doc/models/payment-balance-activity-square-capital-payment-detail.md) | Optional | - | +| `typeSquareCapitalReversedPaymentDetails` | [`PaymentBalanceActivitySquareCapitalReversedPaymentDetail \| undefined`](../../doc/models/payment-balance-activity-square-capital-reversed-payment-detail.md) | Optional | - | +| `typeTaxOnFeeDetails` | [`PaymentBalanceActivityTaxOnFeeDetail \| undefined`](../../doc/models/payment-balance-activity-tax-on-fee-detail.md) | Optional | - | +| `typeThirdPartyFeeDetails` | [`PaymentBalanceActivityThirdPartyFeeDetail \| undefined`](../../doc/models/payment-balance-activity-third-party-fee-detail.md) | Optional | - | +| `typeThirdPartyFeeRefundDetails` | [`PaymentBalanceActivityThirdPartyFeeRefundDetail \| undefined`](../../doc/models/payment-balance-activity-third-party-fee-refund-detail.md) | Optional | - | +| `typeSquarePayrollTransferDetails` | [`PaymentBalanceActivitySquarePayrollTransferDetail \| undefined`](../../doc/models/payment-balance-activity-square-payroll-transfer-detail.md) | Optional | - | +| `typeSquarePayrollTransferReversedDetails` | [`PaymentBalanceActivitySquarePayrollTransferReversedDetail \| undefined`](../../doc/models/payment-balance-activity-square-payroll-transfer-reversed-detail.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "id": "id8", + "payout_id": "payout_id4", + "effective_at": "effective_at8", + "type": "AUTOMATIC_SAVINGS_REVERSED", + "gross_amount_money": { + "amount": 186, + "currency": "MNT" + }, + "fee_amount_money": { + "amount": 126, + "currency": "CHF" + }, + "net_amount_money": { + "amount": 6, + "currency": "XPT" + } +} +``` + diff --git a/legacy/doc/models/payout-fee-type.md b/legacy/doc/models/payout-fee-type.md new file mode 100644 index 000000000..afc863d6c --- /dev/null +++ b/legacy/doc/models/payout-fee-type.md @@ -0,0 +1,16 @@ + +# Payout Fee Type + +Represents the type of payout fee that can incur as part of a payout. + +## Enumeration + +`PayoutFeeType` + +## Fields + +| Name | Description | +| --- | --- | +| `TRANSFER_FEE` | Fee type associated with transfers. | +| `TAX_ON_TRANSFER_FEE` | Taxes associated with the transfer fee. | + diff --git a/legacy/doc/models/payout-fee.md b/legacy/doc/models/payout-fee.md new file mode 100644 index 000000000..0a1d6649a --- /dev/null +++ b/legacy/doc/models/payout-fee.md @@ -0,0 +1,30 @@ + +# Payout Fee + +Represents a payout fee that can incur as part of a payout. + +## Structure + +`PayoutFee` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `amountMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `effectiveAt` | `string \| null \| undefined` | Optional | The timestamp of when the fee takes effect, in RFC 3339 format. | +| `type` | [`string \| undefined`](../../doc/models/payout-fee-type.md) | Optional | Represents the type of payout fee that can incur as part of a payout. | + +## Example (as JSON) + +```json +{ + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "effective_at": "effective_at0", + "type": "TRANSFER_FEE" +} +``` + diff --git a/legacy/doc/models/payout-status.md b/legacy/doc/models/payout-status.md new file mode 100644 index 000000000..c46bf5af0 --- /dev/null +++ b/legacy/doc/models/payout-status.md @@ -0,0 +1,17 @@ + +# Payout Status + +Payout status types + +## Enumeration + +`PayoutStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `SENT` | Indicates that the payout was successfully sent to the banking destination. | +| `FAILED` | Indicates that the payout was rejected by the banking destination. | +| `PAID` | Indicates that the payout has successfully completed. | + diff --git a/legacy/doc/models/payout-type.md b/legacy/doc/models/payout-type.md new file mode 100644 index 000000000..88d9aff02 --- /dev/null +++ b/legacy/doc/models/payout-type.md @@ -0,0 +1,19 @@ + +# Payout Type + +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. + +## Enumeration + +`PayoutType` + +## Fields + +| Name | Description | +| --- | --- | +| `BATCH` | Payouts that include a list of payout entries that can be considered settled. | +| `SIMPLE` | Payouts that do not have any payout entries associated with them and will
show up as one of the payout entries in a future BATCH payout. | + diff --git a/legacy/doc/models/payout.md b/legacy/doc/models/payout.md new file mode 100644 index 000000000..b8a038333 --- /dev/null +++ b/legacy/doc/models/payout.md @@ -0,0 +1,47 @@ + +# Payout + +An accounting of the amount owed the seller and record of the actual transfer to their +external bank account or to the Square balance. + +## Structure + +`Payout` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string` | Required | A unique ID for the payout.
**Constraints**: *Minimum Length*: `1` | +| `status` | [`string \| undefined`](../../doc/models/payout-status.md) | Optional | Payout status types | +| `locationId` | `string` | Required | The ID of the location associated with the payout.
**Constraints**: *Minimum Length*: `1` | +| `createdAt` | `string \| undefined` | Optional | The timestamp of when the payout was created and submitted for deposit to the seller's banking destination, in RFC 3339 format. | +| `updatedAt` | `string \| undefined` | Optional | The timestamp of when the payout was last updated, in RFC 3339 format. | +| `amountMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `destination` | [`Destination \| undefined`](../../doc/models/destination.md) | Optional | Information about the destination against which the payout was made. | +| `version` | `number \| undefined` | Optional | 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` | [`string \| undefined`](../../doc/models/payout-type.md) | Optional | 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. | +| `payoutFee` | [`PayoutFee[] \| null \| undefined`](../../doc/models/payout-fee.md) | Optional | A list of transfer fees and any taxes on the fees assessed by Square for this payout. | +| `arrivalDate` | `string \| null \| undefined` | Optional | The calendar date, in ISO 8601 format (YYYY-MM-DD), when the payout is due to arrive in the seller’s banking destination. | +| `endToEndId` | `string \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "id": "id4", + "status": "SENT", + "location_id": "location_id8", + "created_at": "created_at2", + "updated_at": "updated_at0", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "destination": { + "type": "BANK_ACCOUNT", + "id": "id4" + } +} +``` + diff --git a/legacy/doc/models/phase-input.md b/legacy/doc/models/phase-input.md new file mode 100644 index 000000000..61d548564 --- /dev/null +++ b/legacy/doc/models/phase-input.md @@ -0,0 +1,25 @@ + +# Phase Input + +Represents the arguments used to construct a new phase. + +## Structure + +`PhaseInput` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `ordinal` | `bigint` | Required | index of phase in total subscription plan | +| `orderTemplateId` | `string \| null \| undefined` | Optional | id of order to be used in billing | + +## Example (as JSON) + +```json +{ + "ordinal": 234, + "order_template_id": "order_template_id4" +} +``` + diff --git a/legacy/doc/models/phase.md b/legacy/doc/models/phase.md new file mode 100644 index 000000000..de445effb --- /dev/null +++ b/legacy/doc/models/phase.md @@ -0,0 +1,29 @@ + +# Phase + +Represents a phase, which can override subscription phases as defined by plan_id + +## Structure + +`Phase` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string \| null \| undefined` | Optional | id of subscription phase | +| `ordinal` | `bigint \| null \| undefined` | Optional | index of phase in total subscription plan | +| `orderTemplateId` | `string \| null \| undefined` | Optional | id of order to be used in billing | +| `planPhaseUid` | `string \| null \| undefined` | Optional | the uid from the plan's phase in catalog | + +## Example (as JSON) + +```json +{ + "uid": "uid4", + "ordinal": 12, + "order_template_id": "order_template_id6", + "plan_phase_uid": "plan_phase_uid0" +} +``` + diff --git a/legacy/doc/models/pre-populated-data.md b/legacy/doc/models/pre-populated-data.md new file mode 100644 index 000000000..4e67c827d --- /dev/null +++ b/legacy/doc/models/pre-populated-data.md @@ -0,0 +1,35 @@ + +# Pre Populated Data + +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). + +## Structure + +`PrePopulatedData` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `buyerEmail` | `string \| null \| undefined` | Optional | The buyer email to prepopulate in the payment form.
**Constraints**: *Maximum Length*: `256` | +| `buyerPhoneNumber` | `string \| null \| undefined` | Optional | The buyer phone number to prepopulate in the payment form.
**Constraints**: *Maximum Length*: `17` | +| `buyerAddress` | [`Address \| undefined`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | + +## Example (as JSON) + +```json +{ + "buyer_email": "buyer_email8", + "buyer_phone_number": "buyer_phone_number0", + "buyer_address": { + "address_line_1": "address_line_12", + "address_line_2": "address_line_22", + "address_line_3": "address_line_38", + "locality": "locality2", + "sublocality": "sublocality2" + } +} +``` + diff --git a/legacy/doc/models/processing-fee.md b/legacy/doc/models/processing-fee.md new file mode 100644 index 000000000..2d8d8b0e5 --- /dev/null +++ b/legacy/doc/models/processing-fee.md @@ -0,0 +1,30 @@ + +# Processing Fee + +Represents the Square processing fee. + +## Structure + +`ProcessingFee` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `effectiveAt` | `string \| null \| undefined` | Optional | The timestamp of when the fee takes effect, in RFC 3339 format. | +| `type` | `string \| null \| undefined` | Optional | The type of fee assessed or adjusted. The fee type can be `INITIAL` or `ADJUSTMENT`. | +| `amountMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "effective_at": "effective_at2", + "type": "type8", + "amount_money": { + "amount": 186, + "currency": "AUD" + } +} +``` + diff --git a/legacy/doc/models/product-type.md b/legacy/doc/models/product-type.md new file mode 100644 index 000000000..650994b23 --- /dev/null +++ b/legacy/doc/models/product-type.md @@ -0,0 +1,13 @@ + +# Product Type + +## Enumeration + +`ProductType` + +## Fields + +| Name | +| --- | +| `TERMINAL_API` | + diff --git a/legacy/doc/models/product.md b/legacy/doc/models/product.md new file mode 100644 index 000000000..699d85d8e --- /dev/null +++ b/legacy/doc/models/product.md @@ -0,0 +1,24 @@ + +# Product + +Indicates the Square product used to generate a change. + +## Enumeration + +`Product` + +## Fields + +| Name | Description | +| --- | --- | +| `SQUARE_POS` | Square Point of Sale application. | +| `EXTERNAL_API` | Square Connect APIs (for example, Orders API or Checkout API). | +| `BILLING` | A Square subscription (various products). | +| `APPOINTMENTS` | Square Appointments. | +| `INVOICES` | Square Invoices. | +| `ONLINE_STORE` | Square Online Store. | +| `PAYROLL` | Square Payroll. | +| `DASHBOARD` | Square Dashboard. | +| `ITEM_LIBRARY_IMPORT` | Item Library Import. | +| `OTHER` | A Square product that does not match any other value. | + diff --git a/legacy/doc/models/publish-invoice-request.md b/legacy/doc/models/publish-invoice-request.md new file mode 100644 index 000000000..0c8355d04 --- /dev/null +++ b/legacy/doc/models/publish-invoice-request.md @@ -0,0 +1,25 @@ + +# Publish Invoice Request + +Describes a `PublishInvoice` request. + +## Structure + +`PublishInvoiceRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `version` | `number` | Required | The version of the [invoice](entity:Invoice) to publish.
This must match the current version of the invoice; otherwise, the request is rejected. | +| `idempotencyKey` | `string \| null \| undefined` | Optional | 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).
**Constraints**: *Maximum Length*: `128` | + +## Example (as JSON) + +```json +{ + "idempotency_key": "32da42d0-1997-41b0-826b-f09464fc2c2e", + "version": 1 +} +``` + diff --git a/legacy/doc/models/publish-invoice-response.md b/legacy/doc/models/publish-invoice-response.md new file mode 100644 index 000000000..f8e766bcd --- /dev/null +++ b/legacy/doc/models/publish-invoice-response.md @@ -0,0 +1,107 @@ + +# Publish Invoice Response + +Describes a `PublishInvoice` response. + +## Structure + +`PublishInvoiceResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `invoice` | [`Invoice \| undefined`](../../doc/models/invoice.md) | Optional | 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). | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | + +## Example (as JSON) + +```json +{ + "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", + "address": { + "address_line_1": "address_line_16", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "locality": "locality6", + "sublocality": "sublocality6" + } + }, + "public_url": "https://squareup.com/pay-invoice/inv:0-ChCHu2mZEabLeeHahQnXDjZQECY", + "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 + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/qr-code-options.md b/legacy/doc/models/qr-code-options.md new file mode 100644 index 000000000..7e1743a2b --- /dev/null +++ b/legacy/doc/models/qr-code-options.md @@ -0,0 +1,27 @@ + +# Qr Code Options + +Fields to describe the action that displays QR-Codes. + +## Structure + +`QrCodeOptions` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `title` | `string` | Required | The title text to display in the QR code flow on the Terminal.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `250` | +| `body` | `string` | Required | The body text to display in the QR code flow on the Terminal.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `10000` | +| `barcodeContents` | `string` | Required | The text representation of the data to show in the QR code
as UTF8-encoded data.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `1024` | + +## Example (as JSON) + +```json +{ + "title": "title8", + "body": "body8", + "barcode_contents": "barcode_contents4" +} +``` + diff --git a/legacy/doc/models/quantity-ratio.md b/legacy/doc/models/quantity-ratio.md new file mode 100644 index 000000000..47f214405 --- /dev/null +++ b/legacy/doc/models/quantity-ratio.md @@ -0,0 +1,25 @@ + +# Quantity Ratio + +A whole number or unreduced fractional ratio. + +## Structure + +`QuantityRatio` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `quantity` | `number \| null \| undefined` | Optional | The whole or fractional quantity as the numerator. | +| `quantityDenominator` | `number \| null \| undefined` | Optional | The whole or fractional quantity as the denominator.
With fractional quantity this field is the denominator and quantity is the numerator.
The default value is `1`. For example, when `quantity=3` and `quantity_denominator` is unspecified,
the quantity ratio is `3` or `3/1`. | + +## Example (as JSON) + +```json +{ + "quantity": 86, + "quantity_denominator": 18 +} +``` + diff --git a/legacy/doc/models/quick-pay.md b/legacy/doc/models/quick-pay.md new file mode 100644 index 000000000..ba846439a --- /dev/null +++ b/legacy/doc/models/quick-pay.md @@ -0,0 +1,32 @@ + +# Quick Pay + +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). + +## Structure + +`QuickPay` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `string` | Required | The ad hoc item name. In the resulting `Order`, this name appears as the line item name.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | +| `priceMoney` | [`Money`](../../doc/models/money.md) | Required | 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. | +| `locationId` | `string` | Required | The ID of the business location the checkout is associated with. | + +## Example (as JSON) + +```json +{ + "name": "name8", + "price_money": { + "amount": 202, + "currency": "GTQ" + }, + "location_id": "location_id2" +} +``` + diff --git a/legacy/doc/models/range.md b/legacy/doc/models/range.md new file mode 100644 index 000000000..60c0b91c0 --- /dev/null +++ b/legacy/doc/models/range.md @@ -0,0 +1,25 @@ + +# Range + +The range of a number value between the specified lower and upper bounds. + +## Structure + +`Range` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `min` | `string \| null \| undefined` | Optional | 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` | `string \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "min": "min8", + "max": "max0" +} +``` + diff --git a/legacy/doc/models/receipt-options.md b/legacy/doc/models/receipt-options.md new file mode 100644 index 000000000..a722d9e2e --- /dev/null +++ b/legacy/doc/models/receipt-options.md @@ -0,0 +1,27 @@ + +# Receipt Options + +Describes receipt action fields. + +## Structure + +`ReceiptOptions` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `paymentId` | `string` | Required | The reference to the Square payment ID for the receipt. | +| `printOnly` | `boolean \| null \| undefined` | Optional | Instructs the device to print the receipt without displaying the receipt selection screen.
Requires `printer_enabled` set to true.
Defaults to false. | +| `isDuplicate` | `boolean \| null \| undefined` | Optional | Identify the receipt as a reprint rather than an original receipt.
Defaults to false. | + +## Example (as JSON) + +```json +{ + "payment_id": "payment_id6", + "print_only": false, + "is_duplicate": false +} +``` + diff --git a/legacy/doc/models/redeem-loyalty-reward-request.md b/legacy/doc/models/redeem-loyalty-reward-request.md new file mode 100644 index 000000000..77dc305f8 --- /dev/null +++ b/legacy/doc/models/redeem-loyalty-reward-request.md @@ -0,0 +1,25 @@ + +# Redeem Loyalty Reward Request + +A request to redeem a loyalty reward. + +## Structure + +`RedeemLoyaltyRewardRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string` | Required | A unique string that identifies this `RedeemLoyaltyReward` request.
Keys can be any valid string, but must be unique for every request.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `128` | +| `locationId` | `string` | Required | The ID of the [location](entity:Location) where the reward is redeemed.
**Constraints**: *Minimum Length*: `1` | + +## Example (as JSON) + +```json +{ + "idempotency_key": "98adc7f7-6963-473b-b29c-f3c9cdd7d994", + "location_id": "P034NEENMD09F" +} +``` + diff --git a/legacy/doc/models/redeem-loyalty-reward-response.md b/legacy/doc/models/redeem-loyalty-reward-response.md new file mode 100644 index 000000000..bbd8db3a5 --- /dev/null +++ b/legacy/doc/models/redeem-loyalty-reward-response.md @@ -0,0 +1,70 @@ + +# Redeem Loyalty Reward Response + +A response that includes the `LoyaltyEvent` published for redeeming the reward. + +## Structure + +`RedeemLoyaltyRewardResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `event` | [`LoyaltyEvent \| undefined`](../../doc/models/loyalty-event.md) | Optional | 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). | + +## Example (as JSON) + +```json +{ + "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", + "order_id": "order_id8" + }, + "source": "LOYALTY_API", + "type": "REDEEM_REWARD", + "accumulate_points": { + "loyalty_program_id": "loyalty_program_id8", + "points": 118, + "order_id": "order_id8" + }, + "create_reward": { + "loyalty_program_id": "loyalty_program_id2", + "reward_id": "reward_id6", + "points": 90 + }, + "delete_reward": { + "loyalty_program_id": "loyalty_program_id4", + "reward_id": "reward_id8", + "points": 104 + }, + "adjust_points": { + "loyalty_program_id": "loyalty_program_id2", + "points": 96, + "reason": "reason2" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/refund-payment-request.md b/legacy/doc/models/refund-payment-request.md new file mode 100644 index 000000000..881d73bf6 --- /dev/null +++ b/legacy/doc/models/refund-payment-request.md @@ -0,0 +1,48 @@ + +# Refund Payment Request + +Describes a request to refund a payment using [RefundPayment](../../doc/api/refunds.md#refund-payment). + +## Structure + +`RefundPaymentRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string` | Required | 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).
**Constraints**: *Minimum Length*: `1` | +| `amountMoney` | [`Money`](../../doc/models/money.md) | Required | 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. | +| `appFeeMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `paymentId` | `string \| null \| undefined` | Optional | The unique ID of the payment being refunded.
Required when unlinked=false, otherwise must not be set. | +| `destinationId` | `string \| null \| undefined` | Optional | 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` | `boolean \| null \| undefined` | Optional | 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. | +| `locationId` | `string \| null \| undefined` | Optional | The location ID associated with the unlinked refund.
Required for requests specifying `unlinked=true`.
Otherwise, if included when `unlinked=false`, will throw an error.
**Constraints**: *Maximum Length*: `50` | +| `customerId` | `string \| null \| undefined` | Optional | 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` | `string \| null \| undefined` | Optional | A description of the reason for the refund.
**Constraints**: *Maximum Length*: `192` | +| `paymentVersionToken` | `string \| null \| undefined` | Optional | 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. | +| `teamMemberId` | `string \| null \| undefined` | Optional | An optional [TeamMember](entity:TeamMember) ID to associate with this refund.
**Constraints**: *Maximum Length*: `192` | +| `cashDetails` | [`DestinationDetailsCashRefundDetails \| undefined`](../../doc/models/destination-details-cash-refund-details.md) | Optional | Stores details about a cash refund. Contains only non-confidential information. | +| `externalDetails` | [`DestinationDetailsExternalRefundDetails \| undefined`](../../doc/models/destination-details-external-refund-details.md) | Optional | Stores details about an external refund. Contains only non-confidential information. | + +## Example (as JSON) + +```json +{ + "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", + "destination_id": "destination_id6", + "unlinked": false, + "location_id": "location_id8" +} +``` + diff --git a/legacy/doc/models/refund-payment-response.md b/legacy/doc/models/refund-payment-response.md new file mode 100644 index 000000000..2e266ca00 --- /dev/null +++ b/legacy/doc/models/refund-payment-response.md @@ -0,0 +1,89 @@ + +# Refund Payment Response + +Defines the response returned by +[RefundPayment](../../doc/api/refunds.md#refund-payment). + +If there are errors processing the request, the `refund` field might not be +present, or it might be present with a status of `FAILED`. + +## Structure + +`RefundPaymentResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | +| `refund` | [`PaymentRefund \| undefined`](../../doc/models/payment-refund.md) | Optional | Represents a refund of a payment made using Square. Contains information about
the original payment and the amount of money refunded. | + +## Example (as JSON) + +```json +{ + "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", + "unlinked": false, + "destination_type": "destination_type2", + "destination_details": { + "card_details": { + "card": { + "id": "id6", + "card_brand": "OTHER_BRAND", + "last_4": "last_48", + "exp_month": 228, + "exp_year": 68 + }, + "entry_method": "entry_method8", + "auth_result_code": "auth_result_code0" + }, + "cash_details": { + "seller_supplied_money": { + "amount": 36, + "currency": "MKD" + }, + "change_back_money": { + "amount": 78, + "currency": "XBD" + } + }, + "external_details": { + "type": "type6", + "source": "source0", + "source_id": "source_id8" + } + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/refund-status.md b/legacy/doc/models/refund-status.md new file mode 100644 index 000000000..c2ac20277 --- /dev/null +++ b/legacy/doc/models/refund-status.md @@ -0,0 +1,18 @@ + +# Refund Status + +Indicates a refund's current status. + +## Enumeration + +`RefundStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `PENDING` | The refund is pending. | +| `APPROVED` | The refund has been approved by Square. | +| `REJECTED` | The refund has been rejected by Square. | +| `FAILED` | The refund failed. | + diff --git a/legacy/doc/models/refund.md b/legacy/doc/models/refund.md new file mode 100644 index 000000000..12e145a03 --- /dev/null +++ b/legacy/doc/models/refund.md @@ -0,0 +1,75 @@ + +# Refund + +Represents a refund processed for a Square transaction. + +## Structure + +`Refund` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string` | Required | The refund's unique ID.
**Constraints**: *Maximum Length*: `255` | +| `locationId` | `string` | Required | The ID of the refund's associated location.
**Constraints**: *Maximum Length*: `50` | +| `transactionId` | `string \| null \| undefined` | Optional | The ID of the transaction that the refunded tender is part of.
**Constraints**: *Maximum Length*: `192` | +| `tenderId` | `string` | Required | The ID of the refunded tender.
**Constraints**: *Maximum Length*: `192` | +| `createdAt` | `string \| undefined` | Optional | The timestamp for when the refund was created, in RFC 3339 format.
**Constraints**: *Maximum Length*: `32` | +| `reason` | `string` | Required | The reason for the refund being issued.
**Constraints**: *Maximum Length*: `192` | +| `amountMoney` | [`Money`](../../doc/models/money.md) | Required | 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. | +| `status` | [`string`](../../doc/models/refund-status.md) | Required | Indicates a refund's current status. | +| `processingFeeMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `additionalRecipients` | [`AdditionalRecipient[] \| null \| undefined`](../../doc/models/additional-recipient.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "id": "id6", + "location_id": "location_id0", + "transaction_id": "transaction_id4", + "tender_id": "tender_id4", + "created_at": "created_at6", + "reason": "reason8", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "status": "PENDING", + "processing_fee_money": { + "amount": 112, + "currency": "DJF" + }, + "additional_recipients": [ + { + "location_id": "location_id0", + "description": "description6", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "receivable_id": "receivable_id6" + }, + { + "location_id": "location_id0", + "description": "description6", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "receivable_id": "receivable_id6" + }, + { + "location_id": "location_id0", + "description": "description6", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "receivable_id": "receivable_id6" + } + ] +} +``` + diff --git a/legacy/doc/models/register-domain-request.md b/legacy/doc/models/register-domain-request.md new file mode 100644 index 000000000..a6da40a1b --- /dev/null +++ b/legacy/doc/models/register-domain-request.md @@ -0,0 +1,24 @@ + +# Register Domain Request + +Defines the parameters that can be included in the body of +a request to the [RegisterDomain](../../doc/api/apple-pay.md#register-domain) endpoint. + +## Structure + +`RegisterDomainRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `domainName` | `string` | Required | A domain name as described in RFC-1034 that will be registered with ApplePay.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | + +## Example (as JSON) + +```json +{ + "domain_name": "example.com" +} +``` + diff --git a/legacy/doc/models/register-domain-response-status.md b/legacy/doc/models/register-domain-response-status.md new file mode 100644 index 000000000..ea00a86e2 --- /dev/null +++ b/legacy/doc/models/register-domain-response-status.md @@ -0,0 +1,16 @@ + +# Register Domain Response Status + +The status of the domain registration. + +## Enumeration + +`RegisterDomainResponseStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `PENDING` | The domain is added, but not verified. | +| `VERIFIED` | The domain is added and verified. It can be used to accept Apple Pay transactions. | + diff --git a/legacy/doc/models/register-domain-response.md b/legacy/doc/models/register-domain-response.md new file mode 100644 index 000000000..0db6e9b8f --- /dev/null +++ b/legacy/doc/models/register-domain-response.md @@ -0,0 +1,47 @@ + +# Register Domain Response + +Defines the fields that are included in the response body of +a request to the [RegisterDomain](../../doc/api/apple-pay.md#register-domain) endpoint. + +Either `errors` or `status` are present in a given response (never both). + +## Structure + +`RegisterDomainResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `status` | [`string \| undefined`](../../doc/models/register-domain-response-status.md) | Optional | The status of the domain registration. | + +## Example (as JSON) + +```json +{ + "status": "VERIFIED", + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/remove-group-from-customer-response.md b/legacy/doc/models/remove-group-from-customer-response.md new file mode 100644 index 000000000..1aff6281a --- /dev/null +++ b/legacy/doc/models/remove-group-from-customer-response.md @@ -0,0 +1,38 @@ + +# Remove Group From Customer Response + +Defines the fields that are included in the response body of +a request to the [RemoveGroupFromCustomer](../../doc/api/customers.md#remove-group-from-customer) +endpoint. + +## Structure + +`RemoveGroupFromCustomerResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/resume-subscription-request.md b/legacy/doc/models/resume-subscription-request.md new file mode 100644 index 000000000..dd902b04e --- /dev/null +++ b/legacy/doc/models/resume-subscription-request.md @@ -0,0 +1,26 @@ + +# Resume Subscription Request + +Defines input parameters in a request to the +[ResumeSubscription](../../doc/api/subscriptions.md#resume-subscription) endpoint. + +## Structure + +`ResumeSubscriptionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `resumeEffectiveDate` | `string \| null \| undefined` | Optional | The `YYYY-MM-DD`-formatted date when the subscription reactivated. | +| `resumeChangeTiming` | [`string \| undefined`](../../doc/models/change-timing.md) | Optional | Supported timings when a pending change, as an action, takes place to a subscription. | + +## Example (as JSON) + +```json +{ + "resume_effective_date": "resume_effective_date8", + "resume_change_timing": "IMMEDIATE" +} +``` + diff --git a/legacy/doc/models/resume-subscription-response.md b/legacy/doc/models/resume-subscription-response.md new file mode 100644 index 000000000..820d6edb7 --- /dev/null +++ b/legacy/doc/models/resume-subscription-response.md @@ -0,0 +1,84 @@ + +# Resume Subscription Response + +Defines output parameters in a response from the +[ResumeSubscription](../../doc/api/subscriptions.md#resume-subscription) endpoint. + +## Structure + +`ResumeSubscriptionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Errors encountered during the request. | +| `subscription` | [`Subscription \| undefined`](../../doc/models/subscription.md) | Optional | Represents a subscription purchased by a customer.

For more information, see
[Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). | +| `actions` | [`SubscriptionAction[] \| undefined`](../../doc/models/subscription-action.md) | Optional | A list of `RESUME` actions created by the request and scheduled for the subscription. | + +## Example (as JSON) + +```json +{ + "actions": [ + { + "effective_date": "2023-09-01", + "id": "18ff74f4-3da4-30c5-929f-7d6fca84f115", + "type": "RESUME", + "monthly_billing_anchor_date": 186, + "phases": [ + { + "uid": "uid0", + "ordinal": 78, + "order_template_id": "order_template_id2", + "plan_phase_uid": "plan_phase_uid6" + }, + { + "uid": "uid0", + "ordinal": 78, + "order_template_id": "order_template_id2", + "plan_phase_uid": "plan_phase_uid6" + }, + { + "uid": "uid0", + "ordinal": 78, + "order_template_id": "order_template_id2", + "plan_phase_uid": "plan_phase_uid6" + } + ] + } + ], + "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 + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-booking-custom-attribute-definition-request.md b/legacy/doc/models/retrieve-booking-custom-attribute-definition-request.md new file mode 100644 index 000000000..a3742eebe --- /dev/null +++ b/legacy/doc/models/retrieve-booking-custom-attribute-definition-request.md @@ -0,0 +1,23 @@ + +# Retrieve Booking Custom Attribute Definition Request + +Represents a [RetrieveBookingCustomAttributeDefinition](../../doc/api/booking-custom-attributes.md#retrieve-booking-custom-attribute-definition) request. + +## Structure + +`RetrieveBookingCustomAttributeDefinitionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `version` | `number \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "version": 70 +} +``` + diff --git a/legacy/doc/models/retrieve-booking-custom-attribute-definition-response.md b/legacy/doc/models/retrieve-booking-custom-attribute-definition-response.md new file mode 100644 index 000000000..4188e64e0 --- /dev/null +++ b/legacy/doc/models/retrieve-booking-custom-attribute-definition-response.md @@ -0,0 +1,38 @@ + +# Retrieve Booking Custom Attribute Definition Response + +Represents a [RetrieveBookingCustomAttributeDefinition](../../doc/api/booking-custom-attributes.md#retrieve-booking-custom-attribute-definition) response. +Either `custom_attribute_definition` or `errors` is present in the response. + +## Structure + +`RetrieveBookingCustomAttributeDefinitionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttributeDefinition` | [`CustomAttributeDefinition \| undefined`](../../doc/models/custom-attribute-definition.md) | Optional | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "custom_attribute_definition": { + "created_at": "2022-11-16T15:27:30Z", + "description": "The favorite shampoo of the customer.", + "key": "favoriteShampoo", + "name": "Favorite shampoo", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "updated_at": "2022-11-16T15:27:30Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "errors": [] +} +``` + diff --git a/legacy/doc/models/retrieve-booking-custom-attribute-request.md b/legacy/doc/models/retrieve-booking-custom-attribute-request.md new file mode 100644 index 000000000..39492d88d --- /dev/null +++ b/legacy/doc/models/retrieve-booking-custom-attribute-request.md @@ -0,0 +1,25 @@ + +# Retrieve Booking Custom Attribute Request + +Represents a [RetrieveBookingCustomAttribute](../../doc/api/booking-custom-attributes.md#retrieve-booking-custom-attribute) request. + +## Structure + +`RetrieveBookingCustomAttributeRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `withDefinition` | `boolean \| null \| undefined` | Optional | 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` | `number \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "with_definition": false, + "version": 186 +} +``` + diff --git a/legacy/doc/models/retrieve-booking-custom-attribute-response.md b/legacy/doc/models/retrieve-booking-custom-attribute-response.md new file mode 100644 index 000000000..ec9aab6a1 --- /dev/null +++ b/legacy/doc/models/retrieve-booking-custom-attribute-response.md @@ -0,0 +1,63 @@ + +# Retrieve Booking Custom Attribute Response + +Represents a [RetrieveBookingCustomAttribute](../../doc/api/booking-custom-attributes.md#retrieve-booking-custom-attribute) response. +Either `custom_attribute_definition` or `errors` is present in the response. + +## Structure + +`RetrieveBookingCustomAttributeResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttribute` | [`CustomAttribute \| undefined`](../../doc/models/custom-attribute.md) | Optional | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-booking-response.md b/legacy/doc/models/retrieve-booking-response.md new file mode 100644 index 000000000..77c5f7a62 --- /dev/null +++ b/legacy/doc/models/retrieve-booking-response.md @@ -0,0 +1,42 @@ + +# Retrieve Booking Response + +## Structure + +`RetrieveBookingResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `booking` | [`Booking \| undefined`](../../doc/models/booking.md) | Optional | 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. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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": [] +} +``` + diff --git a/legacy/doc/models/retrieve-business-booking-profile-response.md b/legacy/doc/models/retrieve-business-booking-profile-response.md new file mode 100644 index 000000000..e8ec14600 --- /dev/null +++ b/legacy/doc/models/retrieve-business-booking-profile-response.md @@ -0,0 +1,45 @@ + +# Retrieve Business Booking Profile Response + +## Structure + +`RetrieveBusinessBookingProfileResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `businessBookingProfile` | [`BusinessBookingProfile \| undefined`](../../doc/models/business-booking-profile.md) | Optional | A seller's business booking profile, including booking policy, appointment settings, etc. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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": [] +} +``` + diff --git a/legacy/doc/models/retrieve-card-response.md b/legacy/doc/models/retrieve-card-response.md new file mode 100644 index 000000000..fef5f874b --- /dev/null +++ b/legacy/doc/models/retrieve-card-response.md @@ -0,0 +1,66 @@ + +# Retrieve Card Response + +Defines the fields that are included in the response body of +a request to the [RetrieveCard](../../doc/api/cards.md#retrieve-card) endpoint. + +Note: if there are errors processing the request, the card field will not be +present. + +## Structure + +`RetrieveCardResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | +| `card` | [`Card \| undefined`](../../doc/models/card.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "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", + "id": "ccof:uIbfJXhXETSP197M3GB", + "last_4": "1111", + "merchant_id": "6SSW7HV8K2ST5", + "prepaid_type": "NOT_PREPAID", + "reference_id": "user-id-1", + "version": 1 + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-cash-drawer-shift-request.md b/legacy/doc/models/retrieve-cash-drawer-shift-request.md new file mode 100644 index 000000000..5f2bf7ac3 --- /dev/null +++ b/legacy/doc/models/retrieve-cash-drawer-shift-request.md @@ -0,0 +1,21 @@ + +# Retrieve Cash Drawer Shift Request + +## Structure + +`RetrieveCashDrawerShiftRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationId` | `string` | Required | The ID of the location to retrieve cash drawer shifts from.
**Constraints**: *Minimum Length*: `1` | + +## Example (as JSON) + +```json +{ + "location_id": "location_id6" +} +``` + diff --git a/legacy/doc/models/retrieve-cash-drawer-shift-response.md b/legacy/doc/models/retrieve-cash-drawer-shift-response.md new file mode 100644 index 000000000..731af5cd1 --- /dev/null +++ b/legacy/doc/models/retrieve-cash-drawer-shift-response.md @@ -0,0 +1,77 @@ + +# Retrieve Cash Drawer Shift Response + +## Structure + +`RetrieveCashDrawerShiftResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `cashDrawerShift` | [`CashDrawerShift \| undefined`](../../doc/models/cash-drawer-shift.md) | Optional | 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. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-catalog-object-request.md b/legacy/doc/models/retrieve-catalog-object-request.md new file mode 100644 index 000000000..7ee6fbe89 --- /dev/null +++ b/legacy/doc/models/retrieve-catalog-object-request.md @@ -0,0 +1,25 @@ + +# Retrieve Catalog Object Request + +## Structure + +`RetrieveCatalogObjectRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `includeRelatedObjects` | `boolean \| null \| undefined` | Optional | 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` | +| `catalogVersion` | `bigint \| null \| undefined` | Optional | 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](../../doc/models/catalog-object.md)s. If not included, results will
be from the current version of the catalog. | +| `includeCategoryPathToRoot` | `boolean \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "include_related_objects": false, + "catalog_version": 224, + "include_category_path_to_root": false +} +``` + diff --git a/legacy/doc/models/retrieve-catalog-object-response.md b/legacy/doc/models/retrieve-catalog-object-response.md new file mode 100644 index 000000000..e2035b2ca --- /dev/null +++ b/legacy/doc/models/retrieve-catalog-object-response.md @@ -0,0 +1,171 @@ + +# Retrieve Catalog Object Response + +## Structure + +`RetrieveCatalogObjectResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `object` | [`CatalogObject \| undefined`](../../doc/models/catalog-object.md) | Optional | 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. | +| `relatedObjects` | [`CatalogObject[] \| undefined`](../../doc/models/catalog-object.md) | Optional | A list of `CatalogObject`s referenced by the object in the `object` field. | + +## Example (as JSON) + +```json +{ + "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, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] + }, + "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, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] + }, + { + "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, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-customer-custom-attribute-definition-request.md b/legacy/doc/models/retrieve-customer-custom-attribute-definition-request.md new file mode 100644 index 000000000..c7f9f2753 --- /dev/null +++ b/legacy/doc/models/retrieve-customer-custom-attribute-definition-request.md @@ -0,0 +1,23 @@ + +# Retrieve Customer Custom Attribute Definition Request + +Represents a [RetrieveCustomerCustomAttributeDefinition](../../doc/api/customer-custom-attributes.md#retrieve-customer-custom-attribute-definition) request. + +## Structure + +`RetrieveCustomerCustomAttributeDefinitionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `version` | `number \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "version": 38 +} +``` + diff --git a/legacy/doc/models/retrieve-customer-custom-attribute-definition-response.md b/legacy/doc/models/retrieve-customer-custom-attribute-definition-response.md new file mode 100644 index 000000000..d4340c532 --- /dev/null +++ b/legacy/doc/models/retrieve-customer-custom-attribute-definition-response.md @@ -0,0 +1,51 @@ + +# Retrieve Customer Custom Attribute Definition Response + +Represents a [RetrieveCustomerCustomAttributeDefinition](../../doc/api/customer-custom-attributes.md#retrieve-customer-custom-attribute-definition) response. +Either `custom_attribute_definition` or `errors` is present in the response. + +## Structure + +`RetrieveCustomerCustomAttributeDefinitionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttributeDefinition` | [`CustomAttributeDefinition \| undefined`](../../doc/models/custom-attribute-definition.md) | Optional | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "custom_attribute_definition": { + "created_at": "2022-04-26T15:27:30Z", + "description": "The favorite movie of the customer.", + "key": "favoritemovie", + "name": "Favorite Movie", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "updated_at": "2022-04-26T15:27:30Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-customer-custom-attribute-request.md b/legacy/doc/models/retrieve-customer-custom-attribute-request.md new file mode 100644 index 000000000..07e2e6faa --- /dev/null +++ b/legacy/doc/models/retrieve-customer-custom-attribute-request.md @@ -0,0 +1,25 @@ + +# Retrieve Customer Custom Attribute Request + +Represents a [RetrieveCustomerCustomAttribute](../../doc/api/customer-custom-attributes.md#retrieve-customer-custom-attribute) request. + +## Structure + +`RetrieveCustomerCustomAttributeRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `withDefinition` | `boolean \| null \| undefined` | Optional | 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` | `number \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "with_definition": false, + "version": 232 +} +``` + diff --git a/legacy/doc/models/retrieve-customer-custom-attribute-response.md b/legacy/doc/models/retrieve-customer-custom-attribute-response.md new file mode 100644 index 000000000..d01f3efc2 --- /dev/null +++ b/legacy/doc/models/retrieve-customer-custom-attribute-response.md @@ -0,0 +1,51 @@ + +# Retrieve Customer Custom Attribute Response + +Represents a [RetrieveCustomerCustomAttribute](../../doc/api/customer-custom-attributes.md#retrieve-customer-custom-attribute) response. +Either `custom_attribute_definition` or `errors` is present in the response. + +## Structure + +`RetrieveCustomerCustomAttributeResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttribute` | [`CustomAttribute \| undefined`](../../doc/models/custom-attribute.md) | Optional | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-customer-group-response.md b/legacy/doc/models/retrieve-customer-group-response.md new file mode 100644 index 000000000..58f07a4af --- /dev/null +++ b/legacy/doc/models/retrieve-customer-group-response.md @@ -0,0 +1,40 @@ + +# Retrieve Customer Group Response + +Defines the fields that are included in the response body of +a request to the [RetrieveCustomerGroup](../../doc/api/customer-groups.md#retrieve-customer-group) endpoint. + +Either `errors` or `group` is present in a given response (never both). + +## Structure + +`RetrieveCustomerGroupResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `group` | [`CustomerGroup \| undefined`](../../doc/models/customer-group.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "group": { + "created_at": "2020-04-13T21:54:57.863Z", + "id": "2TAT3CMH4Q0A9M87XJZED0WMR3", + "name": "Loyal Customers", + "updated_at": "2020-04-13T21:54:58Z" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-customer-response.md b/legacy/doc/models/retrieve-customer-response.md new file mode 100644 index 000000000..849f50a8c --- /dev/null +++ b/legacy/doc/models/retrieve-customer-response.md @@ -0,0 +1,85 @@ + +# Retrieve Customer Response + +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). + +## Structure + +`RetrieveCustomerResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `customer` | [`Customer \| undefined`](../../doc/models/customer.md) | Optional | Represents a Square customer profile in the Customer Directory of a Square seller. | + +## Example (as JSON) + +```json +{ + "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, + "cards": [ + { + "id": "id8", + "card_brand": "DISCOVER", + "last_4": "last_40", + "exp_month": 152, + "exp_year": 144 + } + ] + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-customer-segment-response.md b/legacy/doc/models/retrieve-customer-segment-response.md new file mode 100644 index 000000000..314e74484 --- /dev/null +++ b/legacy/doc/models/retrieve-customer-segment-response.md @@ -0,0 +1,45 @@ + +# Retrieve Customer Segment Response + +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). + +## Structure + +`RetrieveCustomerSegmentResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `segment` | [`CustomerSegment \| undefined`](../../doc/models/customer-segment.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "segment": { + "created_at": "2020-01-09T19:33:24.469Z", + "id": "GMNXRZVEXNQDF.CHURN_RISK", + "name": "Lapsed", + "updated_at": "2020-04-13T23:01:13Z" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-dispute-evidence-response.md b/legacy/doc/models/retrieve-dispute-evidence-response.md new file mode 100644 index 000000000..8fc55a228 --- /dev/null +++ b/legacy/doc/models/retrieve-dispute-evidence-response.md @@ -0,0 +1,43 @@ + +# Retrieve Dispute Evidence Response + +Defines the fields in a `RetrieveDisputeEvidence` response. + +## Structure + +`RetrieveDisputeEvidenceResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `evidence` | [`DisputeEvidence \| undefined`](../../doc/models/dispute-evidence.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "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", + "evidence_id": "evidence_id0", + "evidence_text": "evidence_text6" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-dispute-response.md b/legacy/doc/models/retrieve-dispute-response.md new file mode 100644 index 000000000..89e9b77ab --- /dev/null +++ b/legacy/doc/models/retrieve-dispute-response.md @@ -0,0 +1,52 @@ + +# Retrieve Dispute Response + +Defines fields in a `RetrieveDispute` response. + +## Structure + +`RetrieveDisputeResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | +| `dispute` | [`Dispute \| undefined`](../../doc/models/dispute.md) | Optional | Represents a [dispute](https://developer.squareup.com/docs/disputes-api/overview) a cardholder initiated with their bank. | + +## Example (as JSON) + +```json +{ + "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, + "dispute_id": "dispute_id8" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-employee-response.md b/legacy/doc/models/retrieve-employee-response.md new file mode 100644 index 000000000..abefeea52 --- /dev/null +++ b/legacy/doc/models/retrieve-employee-response.md @@ -0,0 +1,42 @@ + +# Retrieve Employee Response + +## Structure + +`RetrieveEmployeeResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `employee` | [`Employee \| undefined`](../../doc/models/employee.md) | Optional | An employee object that is used by the external API.

DEPRECATED at version 2020-08-26. Replaced by [TeamMember](entity:TeamMember). | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "employee": { + "id": "id8", + "first_name": "first_name8", + "last_name": "last_name6", + "email": "email8", + "phone_number": "phone_number6" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-gift-card-from-gan-request.md b/legacy/doc/models/retrieve-gift-card-from-gan-request.md new file mode 100644 index 000000000..dec6b0b68 --- /dev/null +++ b/legacy/doc/models/retrieve-gift-card-from-gan-request.md @@ -0,0 +1,23 @@ + +# Retrieve Gift Card From GAN Request + +A request to retrieve gift cards by their GANs. + +## Structure + +`RetrieveGiftCardFromGANRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `gan` | `string` | Required | 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.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `255` | + +## Example (as JSON) + +```json +{ + "gan": "7783320001001635" +} +``` + diff --git a/legacy/doc/models/retrieve-gift-card-from-gan-response.md b/legacy/doc/models/retrieve-gift-card-from-gan-response.md new file mode 100644 index 000000000..0762aa38a --- /dev/null +++ b/legacy/doc/models/retrieve-gift-card-from-gan-response.md @@ -0,0 +1,44 @@ + +# Retrieve Gift Card From GAN Response + +A response that contains a `GiftCard`. This response might contain a set of `Error` objects +if the request resulted in errors. + +## Structure + +`RetrieveGiftCardFromGANResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `giftCard` | [`GiftCard \| undefined`](../../doc/models/gift-card.md) | Optional | Represents a Square gift card. | + +## Example (as JSON) + +```json +{ + "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" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-gift-card-from-nonce-request.md b/legacy/doc/models/retrieve-gift-card-from-nonce-request.md new file mode 100644 index 000000000..4a7ce739d --- /dev/null +++ b/legacy/doc/models/retrieve-gift-card-from-nonce-request.md @@ -0,0 +1,23 @@ + +# Retrieve Gift Card From Nonce Request + +A request to retrieve a gift card by using a payment token. + +## Structure + +`RetrieveGiftCardFromNonceRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `nonce` | `string` | Required | The payment token of the gift card to retrieve. Payment tokens are generated by the
Web Payments SDK or In-App Payments SDK.
**Constraints**: *Minimum Length*: `1` | + +## Example (as JSON) + +```json +{ + "nonce": "cnon:7783322135245171" +} +``` + diff --git a/legacy/doc/models/retrieve-gift-card-from-nonce-response.md b/legacy/doc/models/retrieve-gift-card-from-nonce-response.md new file mode 100644 index 000000000..2b395595b --- /dev/null +++ b/legacy/doc/models/retrieve-gift-card-from-nonce-response.md @@ -0,0 +1,50 @@ + +# Retrieve Gift Card From Nonce Response + +A response that contains a `GiftCard` object. If the request resulted in errors, +the response contains a set of `Error` objects. + +## Structure + +`RetrieveGiftCardFromNonceResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `giftCard` | [`GiftCard \| undefined`](../../doc/models/gift-card.md) | Optional | Represents a Square gift card. | + +## Example (as JSON) + +```json +{ + "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" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-gift-card-response.md b/legacy/doc/models/retrieve-gift-card-response.md new file mode 100644 index 000000000..e8d2d9ec9 --- /dev/null +++ b/legacy/doc/models/retrieve-gift-card-response.md @@ -0,0 +1,50 @@ + +# Retrieve Gift Card Response + +A response that contains a `GiftCard`. The response might contain a set of `Error` objects +if the request resulted in errors. + +## Structure + +`RetrieveGiftCardResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `giftCard` | [`GiftCard \| undefined`](../../doc/models/gift-card.md) | Optional | Represents a Square gift card. | + +## Example (as JSON) + +```json +{ + "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" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-inventory-adjustment-response.md b/legacy/doc/models/retrieve-inventory-adjustment-response.md new file mode 100644 index 000000000..9c97345b0 --- /dev/null +++ b/legacy/doc/models/retrieve-inventory-adjustment-response.md @@ -0,0 +1,44 @@ + +# Retrieve Inventory Adjustment Response + +## Structure + +`RetrieveInventoryAdjustmentResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `adjustment` | [`InventoryAdjustment \| undefined`](../../doc/models/inventory-adjustment.md) | Optional | Represents a change in state or quantity of product inventory at a
particular time and location. | + +## Example (as JSON) + +```json +{ + "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": [] +} +``` + diff --git a/legacy/doc/models/retrieve-inventory-changes-request.md b/legacy/doc/models/retrieve-inventory-changes-request.md new file mode 100644 index 000000000..729d4211a --- /dev/null +++ b/legacy/doc/models/retrieve-inventory-changes-request.md @@ -0,0 +1,23 @@ + +# Retrieve Inventory Changes Request + +## Structure + +`RetrieveInventoryChangesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationIds` | `string \| null \| undefined` | Optional | The [Location](entity:Location) IDs to look up as a comma-separated
list. An empty list queries all locations. | +| `cursor` | `string \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "location_ids": "location_ids2", + "cursor": "cursor4" +} +``` + diff --git a/legacy/doc/models/retrieve-inventory-changes-response.md b/legacy/doc/models/retrieve-inventory-changes-response.md new file mode 100644 index 000000000..366373d14 --- /dev/null +++ b/legacy/doc/models/retrieve-inventory-changes-response.md @@ -0,0 +1,79 @@ + +# Retrieve Inventory Changes Response + +## Structure + +`RetrieveInventoryChangesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `changes` | [`InventoryChange[] \| undefined`](../../doc/models/inventory-change.md) | Optional | The set of inventory changes for the requested object and locations. | +| `cursor` | `string \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "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", + "physical_count": { + "id": "id2", + "reference_id": "reference_id0", + "catalog_object_id": "catalog_object_id6", + "catalog_object_type": "catalog_object_type6", + "state": "SUPPORTED_BY_NEWER_VERSION" + }, + "transfer": { + "id": "id8", + "reference_id": "reference_id6", + "state": "RESERVED_FOR_SALE", + "from_location_id": "from_location_id0", + "to_location_id": "to_location_id0" + }, + "measurement_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 184 + } + } + ], + "errors": [], + "cursor": "cursor0" +} +``` + diff --git a/legacy/doc/models/retrieve-inventory-count-request.md b/legacy/doc/models/retrieve-inventory-count-request.md new file mode 100644 index 000000000..fd264431f --- /dev/null +++ b/legacy/doc/models/retrieve-inventory-count-request.md @@ -0,0 +1,23 @@ + +# Retrieve Inventory Count Request + +## Structure + +`RetrieveInventoryCountRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationIds` | `string \| null \| undefined` | Optional | The [Location](entity:Location) IDs to look up as a comma-separated
list. An empty list queries all locations. | +| `cursor` | `string \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "location_ids": "location_ids4", + "cursor": "cursor8" +} +``` + diff --git a/legacy/doc/models/retrieve-inventory-count-response.md b/legacy/doc/models/retrieve-inventory-count-response.md new file mode 100644 index 000000000..4baa8238b --- /dev/null +++ b/legacy/doc/models/retrieve-inventory-count-response.md @@ -0,0 +1,34 @@ + +# Retrieve Inventory Count Response + +## Structure + +`RetrieveInventoryCountResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `counts` | [`InventoryCount[] \| undefined`](../../doc/models/inventory-count.md) | Optional | The current calculated inventory counts for the requested object and
locations. | +| `cursor` | `string \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "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": [], + "cursor": "cursor2" +} +``` + diff --git a/legacy/doc/models/retrieve-inventory-physical-count-response.md b/legacy/doc/models/retrieve-inventory-physical-count-response.md new file mode 100644 index 000000000..bffb14d7d --- /dev/null +++ b/legacy/doc/models/retrieve-inventory-physical-count-response.md @@ -0,0 +1,39 @@ + +# Retrieve Inventory Physical Count Response + +## Structure + +`RetrieveInventoryPhysicalCountResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `count` | [`InventoryPhysicalCount \| undefined`](../../doc/models/inventory-physical-count.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "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": [] +} +``` + diff --git a/legacy/doc/models/retrieve-inventory-transfer-response.md b/legacy/doc/models/retrieve-inventory-transfer-response.md new file mode 100644 index 000000000..411e84f87 --- /dev/null +++ b/legacy/doc/models/retrieve-inventory-transfer-response.md @@ -0,0 +1,40 @@ + +# Retrieve Inventory Transfer Response + +## Structure + +`RetrieveInventoryTransferResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `transfer` | [`InventoryTransfer \| undefined`](../../doc/models/inventory-transfer.md) | Optional | Represents the transfer of a quantity of product inventory at a
particular time from one location to another. | + +## Example (as JSON) + +```json +{ + "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" + } +} +``` + diff --git a/legacy/doc/models/retrieve-job-response.md b/legacy/doc/models/retrieve-job-response.md new file mode 100644 index 000000000..d7b186510 --- /dev/null +++ b/legacy/doc/models/retrieve-job-response.md @@ -0,0 +1,46 @@ + +# Retrieve Job Response + +Represents a [RetrieveJob](../../doc/api/team.md#retrieve-job) response. Either `job` or `errors` +is present in the response. + +## Structure + +`RetrieveJobResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `job` | [`Job \| undefined`](../../doc/models/job.md) | Optional | Represents a job that can be assigned to [team members](../../doc/models/team-member.md). This object defines the
job's title and tip eligibility. Compensation is defined in a [job assignment](../../doc/models/job-assignment.md)
in a team member's wage setting. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | The errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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 + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-location-booking-profile-response.md b/legacy/doc/models/retrieve-location-booking-profile-response.md new file mode 100644 index 000000000..f35f845c5 --- /dev/null +++ b/legacy/doc/models/retrieve-location-booking-profile-response.md @@ -0,0 +1,28 @@ + +# Retrieve Location Booking Profile Response + +## Structure + +`RetrieveLocationBookingProfileResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationBookingProfile` | [`LocationBookingProfile \| undefined`](../../doc/models/location-booking-profile.md) | Optional | The booking profile of a seller's location, including the location's ID and whether the location is enabled for online booking. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "errors": [], + "location_booking_profile": { + "booking_enabled": true, + "booking_site_url": "https://square.site/book/L3HETDGYQ4A2C/prod-business", + "location_id": "L3HETDGYQ4A2C", + "online_booking_enabled": false + } +} +``` + diff --git a/legacy/doc/models/retrieve-location-custom-attribute-definition-request.md b/legacy/doc/models/retrieve-location-custom-attribute-definition-request.md new file mode 100644 index 000000000..db1d7aa07 --- /dev/null +++ b/legacy/doc/models/retrieve-location-custom-attribute-definition-request.md @@ -0,0 +1,23 @@ + +# Retrieve Location Custom Attribute Definition Request + +Represents a [RetrieveLocationCustomAttributeDefinition](../../doc/api/location-custom-attributes.md#retrieve-location-custom-attribute-definition) request. + +## Structure + +`RetrieveLocationCustomAttributeDefinitionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `version` | `number \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "version": 50 +} +``` + diff --git a/legacy/doc/models/retrieve-location-custom-attribute-definition-response.md b/legacy/doc/models/retrieve-location-custom-attribute-definition-response.md new file mode 100644 index 000000000..ec124ba2b --- /dev/null +++ b/legacy/doc/models/retrieve-location-custom-attribute-definition-response.md @@ -0,0 +1,57 @@ + +# Retrieve Location Custom Attribute Definition Response + +Represents a [RetrieveLocationCustomAttributeDefinition](../../doc/api/location-custom-attributes.md#retrieve-location-custom-attribute-definition) response. +Either `custom_attribute_definition` or `errors` is present in the response. + +## Structure + +`RetrieveLocationCustomAttributeDefinitionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttributeDefinition` | [`CustomAttributeDefinition \| undefined`](../../doc/models/custom-attribute-definition.md) | Optional | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "custom_attribute_definition": { + "created_at": "2022-12-02T19:06:36.559Z", + "description": "Bestselling item at location", + "key": "bestseller", + "name": "Bestseller", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "updated_at": "2022-12-02T19:06:36.559Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-location-custom-attribute-request.md b/legacy/doc/models/retrieve-location-custom-attribute-request.md new file mode 100644 index 000000000..f88c97f04 --- /dev/null +++ b/legacy/doc/models/retrieve-location-custom-attribute-request.md @@ -0,0 +1,25 @@ + +# Retrieve Location Custom Attribute Request + +Represents a [RetrieveLocationCustomAttribute](../../doc/api/location-custom-attributes.md#retrieve-location-custom-attribute) request. + +## Structure + +`RetrieveLocationCustomAttributeRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `withDefinition` | `boolean \| null \| undefined` | Optional | 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` | `number \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "with_definition": false, + "version": 84 +} +``` + diff --git a/legacy/doc/models/retrieve-location-custom-attribute-response.md b/legacy/doc/models/retrieve-location-custom-attribute-response.md new file mode 100644 index 000000000..4cad197f4 --- /dev/null +++ b/legacy/doc/models/retrieve-location-custom-attribute-response.md @@ -0,0 +1,51 @@ + +# Retrieve Location Custom Attribute Response + +Represents a [RetrieveLocationCustomAttribute](../../doc/api/location-custom-attributes.md#retrieve-location-custom-attribute) response. +Either `custom_attribute_definition` or `errors` is present in the response. + +## Structure + +`RetrieveLocationCustomAttributeResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttribute` | [`CustomAttribute \| undefined`](../../doc/models/custom-attribute.md) | Optional | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-location-response.md b/legacy/doc/models/retrieve-location-response.md new file mode 100644 index 000000000..cb001e5be --- /dev/null +++ b/legacy/doc/models/retrieve-location-response.md @@ -0,0 +1,58 @@ + +# Retrieve Location Response + +Defines the fields that the [RetrieveLocation](../../doc/api/locations.md#retrieve-location) +endpoint returns in a response. + +## Structure + +`RetrieveLocationResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | +| `location` | [`Location \| undefined`](../../doc/models/location.md) | Optional | Represents one of a business' [locations](https://developer.squareup.com/docs/locations-api). | + +## Example (as JSON) + +```json +{ + "location": { + "address": { + "address_line_1": "123 Main St", + "administrative_district_level_1": "CA", + "country": "US", + "locality": "San Francisco", + "postal_code": "94114", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "sublocality": "sublocality6" + }, + "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" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-location-settings-response.md b/legacy/doc/models/retrieve-location-settings-response.md new file mode 100644 index 000000000..a977db1bb --- /dev/null +++ b/legacy/doc/models/retrieve-location-settings-response.md @@ -0,0 +1,93 @@ + +# Retrieve Location Settings Response + +## Structure + +`RetrieveLocationSettingsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `locationSettings` | [`CheckoutLocationSettings \| undefined`](../../doc/models/checkout-location-settings.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "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" + } + ], + "smart_tips": [ + { + "amount": 152, + "currency": "GEL" + }, + { + "amount": 152, + "currency": "GEL" + } + ], + "default_smart_tip": { + "amount": 58, + "currency": "KWD" + } + }, + "updated_at": "2022-06-16T22:25:35Z" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-loyalty-account-response.md b/legacy/doc/models/retrieve-loyalty-account-response.md new file mode 100644 index 000000000..519dd9218 --- /dev/null +++ b/legacy/doc/models/retrieve-loyalty-account-response.md @@ -0,0 +1,52 @@ + +# Retrieve Loyalty Account Response + +A response that includes the loyalty account. + +## Structure + +`RetrieveLoyaltyAccountResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `loyaltyAccount` | [`LoyaltyAccount \| undefined`](../../doc/models/loyalty-account.md) | Optional | Describes a loyalty account in a [loyalty program](../../doc/models/loyalty-program.md). For more information, see
[Create and Retrieve Loyalty Accounts](https://developer.squareup.com/docs/loyalty-api/loyalty-accounts). | + +## Example (as JSON) + +```json +{ + "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", + "enrolled_at": "enrolled_at6" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-loyalty-program-response.md b/legacy/doc/models/retrieve-loyalty-program-response.md new file mode 100644 index 000000000..8267e9b45 --- /dev/null +++ b/legacy/doc/models/retrieve-loyalty-program-response.md @@ -0,0 +1,96 @@ + +# Retrieve Loyalty Program Response + +A response that contains the loyalty program. + +## Structure + +`RetrieveLoyaltyProgramResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `program` | [`LoyaltyProgram \| undefined`](../../doc/models/loyalty-program.md) | Optional | 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). | + +## Example (as JSON) + +```json +{ + "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", + "definition": { + "discount_type": "FIXED_PERCENTAGE", + "percentage_discount": "10", + "scope": "ORDER", + "catalog_object_ids": [ + "catalog_object_ids6" + ], + "fixed_discount_money": { + "amount": 36, + "currency": "SLL" + }, + "max_discount_money": { + "amount": 84, + "currency": "BOB" + } + }, + "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", + "expiration_policy": { + "expiration_duration": "expiration_duration0" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-loyalty-promotion-response.md b/legacy/doc/models/retrieve-loyalty-promotion-response.md new file mode 100644 index 000000000..380d78285 --- /dev/null +++ b/legacy/doc/models/retrieve-loyalty-promotion-response.md @@ -0,0 +1,75 @@ + +# Retrieve Loyalty Promotion Response + +Represents a [RetrieveLoyaltyPromotionPromotions](../../doc/api/loyalty.md#retrieve-loyalty-promotion) response. + +## Structure + +`RetrieveLoyaltyPromotionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `loyaltyPromotion` | [`LoyaltyPromotion \| undefined`](../../doc/models/loyalty-promotion.md) | Optional | Represents a promotion for a [loyalty program](../../doc/models/loyalty-program.md). 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. | + +## Example (as JSON) + +```json +{ + "loyalty_promotion": { + "available_time": { + "start_date": "2022-08-16", + "time_periods": [ + "BEGIN:VEVENT\nDTSTART:20220816T160000\nDURATION:PT2H\nRRULE:FREQ=WEEKLY;BYDAY=TU\nEND:VEVENT" + ], + "end_date": "end_date8" + }, + "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", + "points_addition_data": { + "points_addition": 218 + } + }, + "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", + "canceled_at": "canceled_at0" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-loyalty-reward-response.md b/legacy/doc/models/retrieve-loyalty-reward-response.md new file mode 100644 index 000000000..80a058cd2 --- /dev/null +++ b/legacy/doc/models/retrieve-loyalty-reward-response.md @@ -0,0 +1,48 @@ + +# Retrieve Loyalty Reward Response + +A response that includes the loyalty reward. + +## Structure + +`RetrieveLoyaltyRewardResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `reward` | [`LoyaltyReward \| undefined`](../../doc/models/loyalty-reward.md) | Optional | Represents a contract to redeem loyalty points for a [reward tier](../../doc/models/loyalty-program-reward-tier.md) 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). | + +## Example (as JSON) + +```json +{ + "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", + "order_id": "order_id4" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-merchant-custom-attribute-definition-request.md b/legacy/doc/models/retrieve-merchant-custom-attribute-definition-request.md new file mode 100644 index 000000000..36360139f --- /dev/null +++ b/legacy/doc/models/retrieve-merchant-custom-attribute-definition-request.md @@ -0,0 +1,23 @@ + +# Retrieve Merchant Custom Attribute Definition Request + +Represents a [RetrieveMerchantCustomAttributeDefinition](../../doc/api/merchant-custom-attributes.md#retrieve-merchant-custom-attribute-definition) request. + +## Structure + +`RetrieveMerchantCustomAttributeDefinitionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `version` | `number \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "version": 162 +} +``` + diff --git a/legacy/doc/models/retrieve-merchant-custom-attribute-definition-response.md b/legacy/doc/models/retrieve-merchant-custom-attribute-definition-response.md new file mode 100644 index 000000000..8d08c7dc1 --- /dev/null +++ b/legacy/doc/models/retrieve-merchant-custom-attribute-definition-response.md @@ -0,0 +1,45 @@ + +# Retrieve Merchant Custom Attribute Definition Response + +Represents a [RetrieveMerchantCustomAttributeDefinition](../../doc/api/merchant-custom-attributes.md#retrieve-merchant-custom-attribute-definition) response. +Either `custom_attribute_definition` or `errors` is present in the response. + +## Structure + +`RetrieveMerchantCustomAttributeDefinitionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttributeDefinition` | [`CustomAttributeDefinition \| undefined`](../../doc/models/custom-attribute-definition.md) | Optional | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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": { + "key1": "val1", + "key2": "val2" + }, + "updated_at": "2023-05-05T19:06:36.559Z", + "version": 1, + "visibility": "VISIBILITY_READ_ONLY" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-merchant-custom-attribute-request.md b/legacy/doc/models/retrieve-merchant-custom-attribute-request.md new file mode 100644 index 000000000..b141a75aa --- /dev/null +++ b/legacy/doc/models/retrieve-merchant-custom-attribute-request.md @@ -0,0 +1,25 @@ + +# Retrieve Merchant Custom Attribute Request + +Represents a [RetrieveMerchantCustomAttribute](../../doc/api/merchant-custom-attributes.md#retrieve-merchant-custom-attribute) request. + +## Structure + +`RetrieveMerchantCustomAttributeRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `withDefinition` | `boolean \| null \| undefined` | Optional | 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` | `number \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "with_definition": false, + "version": 52 +} +``` + diff --git a/legacy/doc/models/retrieve-merchant-custom-attribute-response.md b/legacy/doc/models/retrieve-merchant-custom-attribute-response.md new file mode 100644 index 000000000..073829455 --- /dev/null +++ b/legacy/doc/models/retrieve-merchant-custom-attribute-response.md @@ -0,0 +1,57 @@ + +# Retrieve Merchant Custom Attribute Response + +Represents a [RetrieveMerchantCustomAttribute](../../doc/api/merchant-custom-attributes.md#retrieve-merchant-custom-attribute) response. +Either `custom_attribute_definition` or `errors` is present in the response. + +## Structure + +`RetrieveMerchantCustomAttributeResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttribute` | [`CustomAttribute \| undefined`](../../doc/models/custom-attribute.md) | Optional | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-merchant-response.md b/legacy/doc/models/retrieve-merchant-response.md new file mode 100644 index 000000000..bd29a19e4 --- /dev/null +++ b/legacy/doc/models/retrieve-merchant-response.md @@ -0,0 +1,47 @@ + +# Retrieve Merchant Response + +The response object returned by the [RetrieveMerchant](../../doc/api/merchants.md#retrieve-merchant) endpoint. + +## Structure + +`RetrieveMerchantResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | +| `merchant` | [`Merchant \| undefined`](../../doc/models/merchant.md) | Optional | Represents a business that sells with Square. | + +## Example (as JSON) + +```json +{ + "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" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-merchant-settings-response.md b/legacy/doc/models/retrieve-merchant-settings-response.md new file mode 100644 index 000000000..3acff4877 --- /dev/null +++ b/legacy/doc/models/retrieve-merchant-settings-response.md @@ -0,0 +1,76 @@ + +# Retrieve Merchant Settings Response + +## Structure + +`RetrieveMerchantSettingsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `merchantSettings` | [`CheckoutMerchantSettings \| undefined`](../../doc/models/checkout-merchant-settings.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "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 + }, + "cash_app": { + "enabled": false + } + }, + "updated_at": "2022-06-16T22:25:35Z" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-order-custom-attribute-definition-request.md b/legacy/doc/models/retrieve-order-custom-attribute-definition-request.md new file mode 100644 index 000000000..e07af476d --- /dev/null +++ b/legacy/doc/models/retrieve-order-custom-attribute-definition-request.md @@ -0,0 +1,23 @@ + +# Retrieve Order Custom Attribute Definition Request + +Represents a get request for an order custom attribute definition. + +## Structure + +`RetrieveOrderCustomAttributeDefinitionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `version` | `number \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "version": 142 +} +``` + diff --git a/legacy/doc/models/retrieve-order-custom-attribute-definition-response.md b/legacy/doc/models/retrieve-order-custom-attribute-definition-response.md new file mode 100644 index 000000000..8fd4c201f --- /dev/null +++ b/legacy/doc/models/retrieve-order-custom-attribute-definition-response.md @@ -0,0 +1,44 @@ + +# Retrieve Order Custom Attribute Definition Response + +Represents a response from getting an order custom attribute definition. + +## Structure + +`RetrieveOrderCustomAttributeDefinitionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttributeDefinition` | [`CustomAttributeDefinition \| undefined`](../../doc/models/custom-attribute-definition.md) | Optional | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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": { + "key1": "val1", + "key2": "val2" + }, + "updated_at": "2022-10-06T16:53:23.141Z", + "version": 1, + "visibility": "VISIBILITY_READ_WRITE_VALUES" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-order-custom-attribute-request.md b/legacy/doc/models/retrieve-order-custom-attribute-request.md new file mode 100644 index 000000000..48362607c --- /dev/null +++ b/legacy/doc/models/retrieve-order-custom-attribute-request.md @@ -0,0 +1,25 @@ + +# Retrieve Order Custom Attribute Request + +Represents a get request for an order custom attribute. + +## Structure + +`RetrieveOrderCustomAttributeRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `version` | `number \| undefined` | Optional | 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. | +| `withDefinition` | `boolean \| null \| undefined` | Optional | 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`. | + +## Example (as JSON) + +```json +{ + "version": 110, + "with_definition": false +} +``` + diff --git a/legacy/doc/models/retrieve-order-custom-attribute-response.md b/legacy/doc/models/retrieve-order-custom-attribute-response.md new file mode 100644 index 000000000..e879f2b65 --- /dev/null +++ b/legacy/doc/models/retrieve-order-custom-attribute-response.md @@ -0,0 +1,56 @@ + +# Retrieve Order Custom Attribute Response + +Represents a response from getting an order custom attribute. + +## Structure + +`RetrieveOrderCustomAttributeResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttribute` | [`CustomAttribute \| undefined`](../../doc/models/custom-attribute.md) | Optional | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-order-response.md b/legacy/doc/models/retrieve-order-response.md new file mode 100644 index 000000000..2daaf9c5e --- /dev/null +++ b/legacy/doc/models/retrieve-order-response.md @@ -0,0 +1,231 @@ + +# Retrieve Order Response + +## Structure + +`RetrieveOrderResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `order` | [`Order \| undefined`](../../doc/models/order.md) | Optional | 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. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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" + }, + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note4", + "catalog_object_id": "catalog_object_id2" + }, + { + "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" + }, + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note4", + "catalog_object_id": "catalog_object_id2" + } + ], + "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, + "reference_id": "reference_id4", + "source": { + "name": "name4" + }, + "customer_id": "customer_id4" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-payment-link-response.md b/legacy/doc/models/retrieve-payment-link-response.md new file mode 100644 index 000000000..18952a87c --- /dev/null +++ b/legacy/doc/models/retrieve-payment-link-response.md @@ -0,0 +1,69 @@ + +# Retrieve Payment Link Response + +## Structure + +`RetrievePaymentLinkResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `paymentLink` | [`PaymentLink \| undefined`](../../doc/models/payment-link.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "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, + "description": "description2", + "checkout_options": { + "allow_tipping": false, + "custom_fields": [ + { + "title": "title8" + }, + { + "title": "title8" + } + ], + "subscription_plan_id": "subscription_plan_id8", + "redirect_url": "redirect_url2", + "merchant_support_email": "merchant_support_email8" + }, + "pre_populated_data": { + "buyer_email": "buyer_email8", + "buyer_phone_number": "buyer_phone_number0", + "buyer_address": { + "address_line_1": "address_line_12", + "address_line_2": "address_line_22", + "address_line_3": "address_line_38", + "locality": "locality2", + "sublocality": "sublocality2" + } + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-snippet-response.md b/legacy/doc/models/retrieve-snippet-response.md new file mode 100644 index 000000000..b961af0dd --- /dev/null +++ b/legacy/doc/models/retrieve-snippet-response.md @@ -0,0 +1,38 @@ + +# Retrieve Snippet Response + +Represents a `RetrieveSnippet` response. The response can include either `snippet` or `errors`. + +## Structure + +`RetrieveSnippetResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `snippet` | [`Snippet \| undefined`](../../doc/models/snippet.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "snippet": { + "content": "", + "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" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-subscription-request.md b/legacy/doc/models/retrieve-subscription-request.md new file mode 100644 index 000000000..af705ac46 --- /dev/null +++ b/legacy/doc/models/retrieve-subscription-request.md @@ -0,0 +1,24 @@ + +# Retrieve Subscription Request + +Defines input parameters in a request to the +[RetrieveSubscription](../../doc/api/subscriptions.md#retrieve-subscription) endpoint. + +## Structure + +`RetrieveSubscriptionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `include` | `string \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "include": "include2" +} +``` + diff --git a/legacy/doc/models/retrieve-subscription-response.md b/legacy/doc/models/retrieve-subscription-response.md new file mode 100644 index 000000000..ddd6e5479 --- /dev/null +++ b/legacy/doc/models/retrieve-subscription-response.md @@ -0,0 +1,62 @@ + +# Retrieve Subscription Response + +Defines output parameters in a response from the +[RetrieveSubscription](../../doc/api/subscriptions.md#retrieve-subscription) endpoint. + +## Structure + +`RetrieveSubscriptionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Errors encountered during the request. | +| `subscription` | [`Subscription \| undefined`](../../doc/models/subscription.md) | Optional | Represents a subscription purchased by a customer.

For more information, see
[Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). | + +## Example (as JSON) + +```json +{ + "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" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-team-member-booking-profile-response.md b/legacy/doc/models/retrieve-team-member-booking-profile-response.md new file mode 100644 index 000000000..1b9d66954 --- /dev/null +++ b/legacy/doc/models/retrieve-team-member-booking-profile-response.md @@ -0,0 +1,29 @@ + +# Retrieve Team Member Booking Profile Response + +## Structure + +`RetrieveTeamMemberBookingProfileResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `teamMemberBookingProfile` | [`TeamMemberBookingProfile \| undefined`](../../doc/models/team-member-booking-profile.md) | Optional | 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. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "errors": [], + "team_member_booking_profile": { + "display_name": "Sandbox Staff", + "is_bookable": true, + "team_member_id": "TMaJcbiRqPIGZuS9", + "description": "description2", + "profile_image_url": "profile_image_url8" + } +} +``` + diff --git a/legacy/doc/models/retrieve-team-member-response.md b/legacy/doc/models/retrieve-team-member-response.md new file mode 100644 index 000000000..66debd53e --- /dev/null +++ b/legacy/doc/models/retrieve-team-member-response.md @@ -0,0 +1,82 @@ + +# Retrieve Team Member Response + +Represents a response from a retrieve request containing a `TeamMember` object or error messages. + +## Structure + +`RetrieveTeamMemberResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `teamMember` | [`TeamMember \| undefined`](../../doc/models/team-member.md) | Optional | A record representing an individual team member for a business. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | The errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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 + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-token-status-response.md b/legacy/doc/models/retrieve-token-status-response.md new file mode 100644 index 000000000..17633a825 --- /dev/null +++ b/legacy/doc/models/retrieve-token-status-response.md @@ -0,0 +1,48 @@ + +# Retrieve Token Status Response + +Defines the fields that are included in the response body of +a request to the `RetrieveTokenStatus` endpoint. + +## Structure + +`RetrieveTokenStatusResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `scopes` | `string[] \| undefined` | Optional | The list of scopes associated with an access token. | +| `expiresAt` | `string \| undefined` | Optional | The date and time when the `access_token` expires, in RFC 3339 format. Empty if the token never expires. | +| `clientId` | `string \| undefined` | Optional | The Square-issued application ID associated with the access token. This is the same application ID used to obtain the token.
**Constraints**: *Maximum Length*: `191` | +| `merchantId` | `string \| undefined` | Optional | The ID of the authorizing merchant's business.
**Constraints**: *Minimum Length*: `8`, *Maximum Length*: `191` | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "client_id": "CLIENT_ID", + "expires_at": "2022-10-14T14:44:00Z", + "merchant_id": "MERCHANT_ID", + "scopes": [ + "PAYMENTS_READ", + "PAYMENTS_WRITE" + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-transaction-response.md b/legacy/doc/models/retrieve-transaction-response.md new file mode 100644 index 000000000..ca46d06fc --- /dev/null +++ b/legacy/doc/models/retrieve-transaction-response.md @@ -0,0 +1,190 @@ + +# Retrieve Transaction Response + +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). + +## Structure + +`RetrieveTransactionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `transaction` | [`Transaction \| undefined`](../../doc/models/transaction.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "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" + } + ], + "refunds": [ + { + "id": "id8", + "location_id": "location_id2", + "transaction_id": "transaction_id6", + "tender_id": "tender_id6", + "created_at": "created_at6", + "reason": "reason4", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "status": "PENDING", + "processing_fee_money": { + "amount": 112, + "currency": "DJF" + }, + "additional_recipients": [ + { + "location_id": "location_id0", + "description": "description6", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "receivable_id": "receivable_id6" + }, + { + "location_id": "location_id0", + "description": "description6", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "receivable_id": "receivable_id6" + } + ] + }, + { + "id": "id8", + "location_id": "location_id2", + "transaction_id": "transaction_id6", + "tender_id": "tender_id6", + "created_at": "created_at6", + "reason": "reason4", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "status": "PENDING", + "processing_fee_money": { + "amount": 112, + "currency": "DJF" + }, + "additional_recipients": [ + { + "location_id": "location_id0", + "description": "description6", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "receivable_id": "receivable_id6" + }, + { + "location_id": "location_id0", + "description": "description6", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "receivable_id": "receivable_id6" + } + ] + }, + { + "id": "id8", + "location_id": "location_id2", + "transaction_id": "transaction_id6", + "tender_id": "tender_id6", + "created_at": "created_at6", + "reason": "reason4", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "status": "PENDING", + "processing_fee_money": { + "amount": 112, + "currency": "DJF" + }, + "additional_recipients": [ + { + "location_id": "location_id0", + "description": "description6", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "receivable_id": "receivable_id6" + }, + { + "location_id": "location_id0", + "description": "description6", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "receivable_id": "receivable_id6" + } + ] + } + ] + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-vendor-response.md b/legacy/doc/models/retrieve-vendor-response.md new file mode 100644 index 000000000..64b8eeef9 --- /dev/null +++ b/legacy/doc/models/retrieve-vendor-response.md @@ -0,0 +1,44 @@ + +# Retrieve Vendor Response + +Represents an output from a call to [RetrieveVendor](../../doc/api/vendors.md#retrieve-vendor). + +## Structure + +`RetrieveVendorResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Errors encountered when the request fails. | +| `vendor` | [`Vendor \| undefined`](../../doc/models/vendor.md) | Optional | Represents a supplier to a seller. | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "vendor": { + "id": "id6", + "created_at": "created_at4", + "updated_at": "updated_at2", + "name": "name6", + "address": { + "address_line_1": "address_line_16", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "locality": "locality6", + "sublocality": "sublocality6" + } + } +} +``` + diff --git a/legacy/doc/models/retrieve-wage-setting-response.md b/legacy/doc/models/retrieve-wage-setting-response.md new file mode 100644 index 000000000..92377c843 --- /dev/null +++ b/legacy/doc/models/retrieve-wage-setting-response.md @@ -0,0 +1,66 @@ + +# Retrieve Wage Setting Response + +Represents a response from a retrieve request containing the specified `WageSetting` object or error messages. + +## Structure + +`RetrieveWageSettingResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `wageSetting` | [`WageSetting \| undefined`](../../doc/models/wage-setting.md) | Optional | Represents information about the overtime exemption status, job assignments, and compensation
for a [team member](../../doc/models/team-member.md). | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | The errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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, + "job_id": "job_id2" + } + ], + "team_member_id": "1yJlHapkseYnNPETIU1B", + "updated_at": "2020-06-11T23:01:21+00:00", + "version": 1 + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/retrieve-webhook-subscription-response.md b/legacy/doc/models/retrieve-webhook-subscription-response.md new file mode 100644 index 000000000..c977c8c57 --- /dev/null +++ b/legacy/doc/models/retrieve-webhook-subscription-response.md @@ -0,0 +1,49 @@ + +# Retrieve Webhook Subscription Response + +Defines the fields that are included in the response body of +a request to the [RetrieveWebhookSubscription](../../doc/api/webhook-subscriptions.md#retrieve-webhook-subscription) endpoint. + +Note: if there are errors processing the request, the [Subscription](../../doc/models/webhook-subscription.md) will not be +present. + +## Structure + +`RetrieveWebhookSubscriptionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | +| `subscription` | [`WebhookSubscription \| undefined`](../../doc/models/webhook-subscription.md) | Optional | Represents the details of a webhook subscription, including notification URL,
event types, and signature key. | + +## Example (as JSON) + +```json +{ + "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" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/revoke-token-request.md b/legacy/doc/models/revoke-token-request.md new file mode 100644 index 000000000..4992bca19 --- /dev/null +++ b/legacy/doc/models/revoke-token-request.md @@ -0,0 +1,27 @@ + +# Revoke Token Request + +## Structure + +`RevokeTokenRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `clientId` | `string \| null \| undefined` | Optional | The Square-issued ID for your application, which is available on the **OAuth** page in the
[Developer Dashboard](https://developer.squareup.com/apps).
**Constraints**: *Maximum Length*: `191` | +| `accessToken` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Minimum Length*: `2`, *Maximum Length*: `1024` | +| `merchantId` | `string \| null \| undefined` | Optional | The ID of the merchant whose token you want to revoke.
Do not provide a value for `access_token` if you provide this parameter. | +| `revokeOnlyAccessToken` | `boolean \| null \| undefined` | Optional | If `true`, terminate the given single access token, but do not
terminate the entire authorization.
Default: `false` | + +## Example (as JSON) + +```json +{ + "access_token": "ACCESS_TOKEN", + "client_id": "CLIENT_ID", + "merchant_id": "merchant_id8", + "revoke_only_access_token": false +} +``` + diff --git a/legacy/doc/models/revoke-token-response.md b/legacy/doc/models/revoke-token-response.md new file mode 100644 index 000000000..b04a96b0d --- /dev/null +++ b/legacy/doc/models/revoke-token-response.md @@ -0,0 +1,30 @@ + +# Revoke Token Response + +## Structure + +`RevokeTokenResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `success` | `boolean \| undefined` | Optional | If the request is successful, this is `true`. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "success": true, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/risk-evaluation-risk-level.md b/legacy/doc/models/risk-evaluation-risk-level.md new file mode 100644 index 000000000..618df3282 --- /dev/null +++ b/legacy/doc/models/risk-evaluation-risk-level.md @@ -0,0 +1,16 @@ + +# Risk Evaluation Risk Level + +## Enumeration + +`RiskEvaluationRiskLevel` + +## Fields + +| Name | Description | +| --- | --- | +| `PENDING` | Indicates Square is still evaluating the payment. | +| `NORMAL` | Indicates payment risk is within the normal range. | +| `MODERATE` | Indicates elevated risk level associated with the payment. | +| `HIGH` | Indicates significantly elevated risk level with the payment. | + diff --git a/legacy/doc/models/risk-evaluation.md b/legacy/doc/models/risk-evaluation.md new file mode 100644 index 000000000..3298c99d7 --- /dev/null +++ b/legacy/doc/models/risk-evaluation.md @@ -0,0 +1,30 @@ + +# Risk Evaluation + +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). + +## Structure + +`RiskEvaluation` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `createdAt` | `string \| undefined` | Optional | The timestamp when payment risk was evaluated, in RFC 3339 format. | +| `riskLevel` | [`string \| undefined`](../../doc/models/risk-evaluation-risk-level.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "created_at": "created_at0", + "risk_level": "MODERATE" +} +``` + diff --git a/legacy/doc/models/save-card-options.md b/legacy/doc/models/save-card-options.md new file mode 100644 index 000000000..ae6f19bed --- /dev/null +++ b/legacy/doc/models/save-card-options.md @@ -0,0 +1,27 @@ + +# Save Card Options + +Describes save-card action fields. + +## Structure + +`SaveCardOptions` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customerId` | `string` | Required | The square-assigned ID of the customer linked to the saved card. | +| `cardId` | `string \| undefined` | Optional | The id of the created card-on-file.
**Constraints**: *Maximum Length*: `64` | +| `referenceId` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `128` | + +## Example (as JSON) + +```json +{ + "customer_id": "customer_id4", + "card_id": "card_id8", + "reference_id": "reference_id6" +} +``` + diff --git a/legacy/doc/models/search-availability-filter.md b/legacy/doc/models/search-availability-filter.md new file mode 100644 index 000000000..12fcdd582 --- /dev/null +++ b/legacy/doc/models/search-availability-filter.md @@ -0,0 +1,71 @@ + +# Search Availability Filter + +A query filter to search for buyer-accessible availabilities by. + +## Structure + +`SearchAvailabilityFilter` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `startAtRange` | [`TimeRange`](../../doc/models/time-range.md) | Required | 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. | +| `locationId` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `32` | +| `segmentFilters` | [`SegmentFilter[] \| null \| undefined`](../../doc/models/segment-filter.md) | Optional | 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. | +| `bookingId` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `36` | + +## Example (as JSON) + +```json +{ + "start_at_range": { + "start_at": "start_at6", + "end_at": "end_at6" + }, + "location_id": "location_id8", + "segment_filters": [ + { + "service_variation_id": "service_variation_id4", + "team_member_id_filter": { + "all": [ + "all5", + "all6", + "all7" + ], + "any": [ + "any2", + "any3", + "any4" + ], + "none": [ + "none7", + "none8" + ] + } + }, + { + "service_variation_id": "service_variation_id4", + "team_member_id_filter": { + "all": [ + "all5", + "all6", + "all7" + ], + "any": [ + "any2", + "any3", + "any4" + ], + "none": [ + "none7", + "none8" + ] + } + } + ], + "booking_id": "booking_id8" +} +``` + diff --git a/legacy/doc/models/search-availability-query.md b/legacy/doc/models/search-availability-query.md new file mode 100644 index 000000000..290bfd12c --- /dev/null +++ b/legacy/doc/models/search-availability-query.md @@ -0,0 +1,89 @@ + +# Search Availability Query + +The query used to search for buyer-accessible availabilities of bookings. + +## Structure + +`SearchAvailabilityQuery` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `filter` | [`SearchAvailabilityFilter`](../../doc/models/search-availability-filter.md) | Required | A query filter to search for buyer-accessible availabilities by. | + +## Example (as JSON) + +```json +{ + "filter": { + "start_at_range": { + "start_at": "start_at6", + "end_at": "end_at6" + }, + "location_id": "location_id8", + "segment_filters": [ + { + "service_variation_id": "service_variation_id4", + "team_member_id_filter": { + "all": [ + "all5", + "all6", + "all7" + ], + "any": [ + "any2", + "any3", + "any4" + ], + "none": [ + "none7", + "none8" + ] + } + }, + { + "service_variation_id": "service_variation_id4", + "team_member_id_filter": { + "all": [ + "all5", + "all6", + "all7" + ], + "any": [ + "any2", + "any3", + "any4" + ], + "none": [ + "none7", + "none8" + ] + } + }, + { + "service_variation_id": "service_variation_id4", + "team_member_id_filter": { + "all": [ + "all5", + "all6", + "all7" + ], + "any": [ + "any2", + "any3", + "any4" + ], + "none": [ + "none7", + "none8" + ] + } + } + ], + "booking_id": "booking_id8" + } +} +``` + diff --git a/legacy/doc/models/search-availability-request.md b/legacy/doc/models/search-availability-request.md new file mode 100644 index 000000000..f158e968c --- /dev/null +++ b/legacy/doc/models/search-availability-request.md @@ -0,0 +1,89 @@ + +# Search Availability Request + +## Structure + +`SearchAvailabilityRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `query` | [`SearchAvailabilityQuery`](../../doc/models/search-availability-query.md) | Required | The query used to search for buyer-accessible availabilities of bookings. | + +## Example (as JSON) + +```json +{ + "query": { + "filter": { + "start_at_range": { + "start_at": "start_at6", + "end_at": "end_at6" + }, + "location_id": "location_id8", + "segment_filters": [ + { + "service_variation_id": "service_variation_id4", + "team_member_id_filter": { + "all": [ + "all5", + "all6", + "all7" + ], + "any": [ + "any2", + "any3", + "any4" + ], + "none": [ + "none7", + "none8" + ] + } + }, + { + "service_variation_id": "service_variation_id4", + "team_member_id_filter": { + "all": [ + "all5", + "all6", + "all7" + ], + "any": [ + "any2", + "any3", + "any4" + ], + "none": [ + "none7", + "none8" + ] + } + }, + { + "service_variation_id": "service_variation_id4", + "team_member_id_filter": { + "all": [ + "all5", + "all6", + "all7" + ], + "any": [ + "any2", + "any3", + "any4" + ], + "none": [ + "none7", + "none8" + ] + } + } + ], + "booking_id": "booking_id8" + } + } +} +``` + diff --git a/legacy/doc/models/search-availability-response.md b/legacy/doc/models/search-availability-response.md new file mode 100644 index 000000000..520ab8ea9 --- /dev/null +++ b/legacy/doc/models/search-availability-response.md @@ -0,0 +1,276 @@ + +# Search Availability Response + +## Structure + +`SearchAvailabilityResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `availabilities` | [`Availability[] \| undefined`](../../doc/models/availability.md) | Optional | List of appointment slots available for booking. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "availabilities": [ + { + "appointment_segments": [ + { + "duration_minutes": 60, + "service_variation_id": "RU3PBTZTK7DXZDQFCJHOK2MC", + "service_variation_version": 1599775456731, + "team_member_id": "TMXUrsBWWcHTt79t", + "intermission_minutes": 54, + "any_team_member": false + } + ], + "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", + "intermission_minutes": 54, + "any_team_member": false + } + ], + "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", + "intermission_minutes": 54, + "any_team_member": false + } + ], + "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", + "intermission_minutes": 54, + "any_team_member": false + } + ], + "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", + "intermission_minutes": 54, + "any_team_member": false + } + ], + "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", + "intermission_minutes": 54, + "any_team_member": false + } + ], + "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", + "intermission_minutes": 54, + "any_team_member": false + } + ], + "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", + "intermission_minutes": 54, + "any_team_member": false + } + ], + "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", + "intermission_minutes": 54, + "any_team_member": false + } + ], + "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", + "intermission_minutes": 54, + "any_team_member": false + } + ], + "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", + "intermission_minutes": 54, + "any_team_member": false + } + ], + "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", + "intermission_minutes": 54, + "any_team_member": false + } + ], + "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", + "intermission_minutes": 54, + "any_team_member": false + } + ], + "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", + "intermission_minutes": 54, + "any_team_member": false + } + ], + "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", + "intermission_minutes": 54, + "any_team_member": false + } + ], + "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", + "intermission_minutes": 54, + "any_team_member": false + } + ], + "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", + "intermission_minutes": 54, + "any_team_member": false + } + ], + "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", + "intermission_minutes": 54, + "any_team_member": false + } + ], + "location_id": "LEQHH0YY8B42M", + "start_at": "2020-11-27T14:00:00Z" + } + ], + "errors": [] +} +``` + diff --git a/legacy/doc/models/search-catalog-items-request-stock-level.md b/legacy/doc/models/search-catalog-items-request-stock-level.md new file mode 100644 index 000000000..e0a17df86 --- /dev/null +++ b/legacy/doc/models/search-catalog-items-request-stock-level.md @@ -0,0 +1,16 @@ + +# Search Catalog Items Request Stock Level + +Defines supported stock levels of the item inventory. + +## Enumeration + +`SearchCatalogItemsRequestStockLevel` + +## Fields + +| Name | Description | +| --- | --- | +| `OUT` | The item inventory is empty. | +| `LOW` | The item inventory is low. | + diff --git a/legacy/doc/models/search-catalog-items-request.md b/legacy/doc/models/search-catalog-items-request.md new file mode 100644 index 000000000..9d2e30aa3 --- /dev/null +++ b/legacy/doc/models/search-catalog-items-request.md @@ -0,0 +1,69 @@ + +# Search Catalog Items Request + +Defines the request body for the [SearchCatalogItems](../../doc/api/catalog.md#search-catalog-items) endpoint. + +## Structure + +`SearchCatalogItemsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `textFilter` | `string \| undefined` | Optional | 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. | +| `categoryIds` | `string[] \| undefined` | Optional | The category id query expression to return items containing the specified category IDs. | +| `stockLevels` | [`string[] \| undefined`](../../doc/models/search-catalog-items-request-stock-level.md) | Optional | The stock-level query expression to return item variations with the specified stock levels.
See [SearchCatalogItemsRequestStockLevel](#type-searchcatalogitemsrequeststocklevel) for possible values | +| `enabledLocationIds` | `string[] \| undefined` | Optional | The enabled-location query expression to return items and item variations having specified enabled locations. | +| `cursor` | `string \| undefined` | Optional | The pagination token, returned in the previous response, used to fetch the next batch of pending results. | +| `limit` | `number \| undefined` | Optional | The maximum number of results to return per page. The default value is 100.
**Constraints**: `<= 100` | +| `sortOrder` | [`string \| undefined`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | +| `productTypes` | [`string[] \| undefined`](../../doc/models/catalog-item-product-type.md) | Optional | The product types query expression to return items or item variations having the specified product types. | +| `customAttributeFilters` | [`CustomAttributeFilter[] \| undefined`](../../doc/models/custom-attribute-filter.md) | Optional | 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. | +| `archivedState` | [`string \| undefined`](../../doc/models/archived-state.md) | Optional | Defines the values for the `archived_state` query expression
used in [SearchCatalogItems](../../doc/api/catalog.md#search-catalog-items)
to return the archived, not archived or either type of catalog items. | + +## Example (as JSON) + +```json +{ + "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", + "cursor": "cursor4" +} +``` + diff --git a/legacy/doc/models/search-catalog-items-response.md b/legacy/doc/models/search-catalog-items-response.md new file mode 100644 index 000000000..6f881f8e9 --- /dev/null +++ b/legacy/doc/models/search-catalog-items-response.md @@ -0,0 +1,89 @@ + +# Search Catalog Items Response + +Defines the response body returned from the [SearchCatalogItems](../../doc/api/catalog.md#search-catalog-items) endpoint. + +## Structure + +`SearchCatalogItemsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `items` | [`CatalogObject[] \| undefined`](../../doc/models/catalog-object.md) | Optional | Returned items matching the specified query expressions. | +| `cursor` | `string \| undefined` | Optional | Pagination token used in the next request to return more of the search result. | +| `matchedVariationIds` | `string[] \| undefined` | Optional | Ids of returned item variations matching the specified query expression. | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "items": [ + { + "type": "SUBSCRIPTION_PLAN", + "id": "id8", + "updated_at": "updated_at6", + "version": 38, + "is_deleted": false, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key2": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] + } + ], + "cursor": "cursor2", + "matched_variation_ids": [ + "matched_variation_ids3" + ] +} +``` + diff --git a/legacy/doc/models/search-catalog-objects-request.md b/legacy/doc/models/search-catalog-objects-request.md new file mode 100644 index 000000000..7282616f4 --- /dev/null +++ b/legacy/doc/models/search-catalog-objects-request.md @@ -0,0 +1,41 @@ + +# Search Catalog Objects Request + +## Structure + +`SearchCatalogObjectsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `cursor` | `string \| undefined` | Optional | 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. | +| `objectTypes` | [`string[] \| undefined`](../../doc/models/catalog-object-type.md) | Optional | 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. | +| `includeDeletedObjects` | `boolean \| undefined` | Optional | If `true`, deleted objects will be included in the results. Deleted objects will have their
`is_deleted` field set to `true`. | +| `includeRelatedObjects` | `boolean \| undefined` | Optional | 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` | +| `beginTime` | `string \| undefined` | Optional | 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` | [`CatalogQuery \| undefined`](../../doc/models/catalog-query.md) | Optional | 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](../../doc/api/catalog.md#search-catalog-objects).
Any combination of the following types may be used together:

- [exact_query](../../doc/models/catalog-query-exact.md)
- [prefix_query](../../doc/models/catalog-query-prefix.md)
- [range_query](../../doc/models/catalog-query-range.md)
- [sorted_attribute_query](../../doc/models/catalog-query-sorted-attribute.md)
- [text_query](../../doc/models/catalog-query-text.md)

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](../../doc/models/catalog-item.md) objects by searchable attributes, you can use
the `"name"`, `"description"`, or `"abbreviation"` attribute in an applicable query filter. | +| `limit` | `number \| undefined` | Optional | 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. | +| `includeCategoryPathToRoot` | `boolean \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "limit": 100, + "object_types": [ + "ITEM" + ], + "query": { + "prefix_query": { + "attribute_name": "name", + "attribute_prefix": "tea" + } + }, + "cursor": "cursor2", + "include_deleted_objects": false, + "include_related_objects": false, + "begin_time": "begin_time2" +} +``` + diff --git a/legacy/doc/models/search-catalog-objects-response.md b/legacy/doc/models/search-catalog-objects-response.md new file mode 100644 index 000000000..3c04f281f --- /dev/null +++ b/legacy/doc/models/search-catalog-objects-response.md @@ -0,0 +1,231 @@ + +# Search Catalog Objects Response + +## Structure + +`SearchCatalogObjectsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `cursor` | `string \| undefined` | Optional | 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` | [`CatalogObject[] \| undefined`](../../doc/models/catalog-object.md) | Optional | The CatalogObjects returned. | +| `relatedObjects` | [`CatalogObject[] \| undefined`](../../doc/models/catalog-object.md) | Optional | A list of CatalogObjects referenced by the objects in the `objects` field. | +| `latestTime` | `string \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "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, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] + }, + { + "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, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "cursor": "cursor6", + "related_objects": [ + { + "type": "SUBSCRIPTION_PLAN_VARIATION", + "id": "id2", + "updated_at": "updated_at2", + "version": 0, + "is_deleted": false, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] + } + ], + "latest_time": "latest_time2" +} +``` + diff --git a/legacy/doc/models/search-customers-request.md b/legacy/doc/models/search-customers-request.md new file mode 100644 index 000000000..d632eea48 --- /dev/null +++ b/legacy/doc/models/search-customers-request.md @@ -0,0 +1,64 @@ + +# Search Customers Request + +Defines the fields that are included in the request body of a request to the +`SearchCustomers` endpoint. + +## Structure + +`SearchCustomersRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `cursor` | `string \| undefined` | Optional | 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` | `bigint \| undefined` | Optional | 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).
**Constraints**: `>= 1`, `<= 100` | +| `query` | [`CustomerQuery \| undefined`](../../doc/models/customer-query.md) | Optional | Represents filtering and sorting criteria for a [SearchCustomers](../../doc/api/customers.md#search-customers) request. | +| `count` | `boolean \| undefined` | Optional | Indicates whether to return the total count of matching customers in the `count` field of the response.

The default value is `false`. | + +## Example (as JSON) + +```json +{ + "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", + "exact": "exact2" + }, + "group_ids": { + "all": [ + "545AXB44B4XXWMVQ4W8SBT3HHF" + ] + }, + "updated_at": { + "start_at": "start_at6", + "end_at": "end_at6" + }, + "phone_number": { + "exact": "exact2", + "fuzzy": "fuzzy8" + } + }, + "sort": { + "field": "CREATED_AT", + "order": "ASC" + } + }, + "cursor": "cursor0", + "count": false +} +``` + diff --git a/legacy/doc/models/search-customers-response.md b/legacy/doc/models/search-customers-response.md new file mode 100644 index 000000000..91468428e --- /dev/null +++ b/legacy/doc/models/search-customers-response.md @@ -0,0 +1,131 @@ + +# Search Customers Response + +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). + +## Structure + +`SearchCustomersResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `customers` | [`Customer[] \| undefined`](../../doc/models/customer.md) | Optional | 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` | `string \| undefined` | Optional | 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` | `bigint \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "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, + "cards": [ + { + "id": "id8", + "card_brand": "DISCOVER", + "last_4": "last_40", + "exp_month": 152, + "exp_year": 144 + }, + { + "id": "id8", + "card_brand": "DISCOVER", + "last_4": "last_40", + "exp_month": 152, + "exp_year": 144 + } + ] + }, + { + "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, + "cards": [ + { + "id": "id8", + "card_brand": "DISCOVER", + "last_4": "last_40", + "exp_month": 152, + "exp_year": 144 + }, + { + "id": "id8", + "card_brand": "DISCOVER", + "last_4": "last_40", + "exp_month": 152, + "exp_year": 144 + } + ] + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "count": 90 +} +``` + diff --git a/legacy/doc/models/search-events-filter.md b/legacy/doc/models/search-events-filter.md new file mode 100644 index 000000000..a01383218 --- /dev/null +++ b/legacy/doc/models/search-events-filter.md @@ -0,0 +1,43 @@ + +# Search Events Filter + +Criteria to filter events by. + +## Structure + +`SearchEventsFilter` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `eventTypes` | `string[] \| null \| undefined` | Optional | Filter events by event types. | +| `merchantIds` | `string[] \| null \| undefined` | Optional | Filter events by merchant. | +| `locationIds` | `string[] \| null \| undefined` | Optional | Filter events by location. | +| `createdAt` | [`TimeRange \| undefined`](../../doc/models/time-range.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "event_types": [ + "event_types6", + "event_types7", + "event_types8" + ], + "merchant_ids": [ + "merchant_ids5", + "merchant_ids6", + "merchant_ids7" + ], + "location_ids": [ + "location_ids8", + "location_ids9" + ], + "created_at": { + "start_at": "start_at4", + "end_at": "end_at8" + } +} +``` + diff --git a/legacy/doc/models/search-events-query.md b/legacy/doc/models/search-events-query.md new file mode 100644 index 000000000..a37f2ff0b --- /dev/null +++ b/legacy/doc/models/search-events-query.md @@ -0,0 +1,44 @@ + +# Search Events Query + +Contains query criteria for the search. + +## Structure + +`SearchEventsQuery` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `filter` | [`SearchEventsFilter \| undefined`](../../doc/models/search-events-filter.md) | Optional | Criteria to filter events by. | +| `sort` | [`SearchEventsSort \| undefined`](../../doc/models/search-events-sort.md) | Optional | Criteria to sort events by. | + +## Example (as JSON) + +```json +{ + "filter": { + "event_types": [ + "event_types2", + "event_types3" + ], + "merchant_ids": [ + "merchant_ids1", + "merchant_ids2" + ], + "location_ids": [ + "location_ids4" + ], + "created_at": { + "start_at": "start_at4", + "end_at": "end_at8" + } + }, + "sort": { + "field": "DEFAULT", + "order": "DESC" + } +} +``` + diff --git a/legacy/doc/models/search-events-request.md b/legacy/doc/models/search-events-request.md new file mode 100644 index 000000000..d4f2d71a0 --- /dev/null +++ b/legacy/doc/models/search-events-request.md @@ -0,0 +1,49 @@ + +# Search Events Request + +Searches [Event](../../doc/models/event.md)s for your application. + +## Structure + +`SearchEventsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `cursor` | `string \| undefined` | Optional | 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).
**Constraints**: *Maximum Length*: `256` | +| `limit` | `number \| undefined` | Optional | 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
**Constraints**: `>= 1`, `<= 100` | +| `query` | [`SearchEventsQuery \| undefined`](../../doc/models/search-events-query.md) | Optional | Contains query criteria for the search. | + +## Example (as JSON) + +```json +{ + "cursor": "cursor8", + "limit": 176, + "query": { + "filter": { + "event_types": [ + "event_types2", + "event_types3" + ], + "merchant_ids": [ + "merchant_ids1", + "merchant_ids2" + ], + "location_ids": [ + "location_ids4" + ], + "created_at": { + "start_at": "start_at4", + "end_at": "end_at8" + } + }, + "sort": { + "field": "DEFAULT", + "order": "DESC" + } + } +} +``` + diff --git a/legacy/doc/models/search-events-response.md b/legacy/doc/models/search-events-response.md new file mode 100644 index 000000000..fd1154879 --- /dev/null +++ b/legacy/doc/models/search-events-response.md @@ -0,0 +1,85 @@ + +# Search Events Response + +Defines the fields that are included in the response body of +a request to the [SearchEvents](../../doc/api/events.md#search-events) endpoint. + +Note: if there are errors processing the request, the events field will not be +present. + +## Structure + +`SearchEventsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | +| `events` | [`Event[] \| undefined`](../../doc/models/event.md) | Optional | The list of [Event](entity:Event)s returned by the search. | +| `metadata` | [`EventMetadata[] \| undefined`](../../doc/models/event-metadata.md) | Optional | Contains the metadata of an event. For more information, see [Event](entity:Event). | +| `cursor` | `string \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "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" + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/search-events-sort-field.md b/legacy/doc/models/search-events-sort-field.md new file mode 100644 index 000000000..a342344bb --- /dev/null +++ b/legacy/doc/models/search-events-sort-field.md @@ -0,0 +1,15 @@ + +# Search Events Sort Field + +Specifies the sort key for events returned from a search. + +## Enumeration + +`SearchEventsSortField` + +## Fields + +| Name | Description | +| --- | --- | +| `DEFAULT` | Use the default sort key. The default behavior is to sort events by when they were created (`created_at`). | + diff --git a/legacy/doc/models/search-events-sort.md b/legacy/doc/models/search-events-sort.md new file mode 100644 index 000000000..6394e9c83 --- /dev/null +++ b/legacy/doc/models/search-events-sort.md @@ -0,0 +1,25 @@ + +# Search Events Sort + +Criteria to sort events by. + +## Structure + +`SearchEventsSort` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `field` | [`string \| undefined`](../../doc/models/search-events-sort-field.md) | Optional | Specifies the sort key for events returned from a search. | +| `order` | [`string \| undefined`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | + +## Example (as JSON) + +```json +{ + "field": "DEFAULT", + "order": "DESC" +} +``` + diff --git a/legacy/doc/models/search-invoices-request.md b/legacy/doc/models/search-invoices-request.md new file mode 100644 index 000000000..9d1c05596 --- /dev/null +++ b/legacy/doc/models/search-invoices-request.md @@ -0,0 +1,41 @@ + +# Search Invoices Request + +Describes a `SearchInvoices` request. + +## Structure + +`SearchInvoicesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `query` | [`InvoiceQuery`](../../doc/models/invoice-query.md) | Required | Describes query criteria for searching invoices. | +| `limit` | `number \| undefined` | Optional | 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` | `string \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "query": { + "filter": { + "customer_ids": [ + "JDKYHBWT1D4F8MFH63DBMEN8Y4" + ], + "location_ids": [ + "ES0RJRZYEC39A" + ] + }, + "limit": 100, + "sort": { + "field": "INVOICE_SORT_DATE", + "order": "DESC" + } + }, + "limit": 26, + "cursor": "cursor4" +} +``` + diff --git a/legacy/doc/models/search-invoices-response.md b/legacy/doc/models/search-invoices-response.md new file mode 100644 index 000000000..21d038fa5 --- /dev/null +++ b/legacy/doc/models/search-invoices-response.md @@ -0,0 +1,191 @@ + +# Search Invoices Response + +Describes a `SearchInvoices` response. + +## Structure + +`SearchInvoicesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `invoices` | [`Invoice[] \| undefined`](../../doc/models/invoice.md) | Optional | The list of invoices returned by the search. | +| `cursor` | `string \| undefined` | Optional | 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` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | + +## Example (as JSON) + +```json +{ + "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", + "address": { + "address_line_1": "address_line_16", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "locality": "locality6", + "sublocality": "sublocality6" + } + }, + "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", + "address": { + "address_line_1": "address_line_16", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "locality": "locality6", + "sublocality": "sublocality6" + } + }, + "public_url": "https://squareup.com/pay-invoice/h9sfsfTGTSnYEhISUDBhEQ", + "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 + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/search-loyalty-accounts-request-loyalty-account-query.md b/legacy/doc/models/search-loyalty-accounts-request-loyalty-account-query.md new file mode 100644 index 000000000..7be7861bb --- /dev/null +++ b/legacy/doc/models/search-loyalty-accounts-request-loyalty-account-query.md @@ -0,0 +1,45 @@ + +# Search Loyalty Accounts Request Loyalty Account Query + +The search criteria for the loyalty accounts. + +## Structure + +`SearchLoyaltyAccountsRequestLoyaltyAccountQuery` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `mappings` | [`LoyaltyAccountMapping[] \| null \| undefined`](../../doc/models/loyalty-account-mapping.md) | Optional | The set of mappings to use in the loyalty account search.

This cannot be combined with `customer_ids`.

Max: 30 mappings | +| `customerIds` | `string[] \| null \| undefined` | Optional | The set of customer IDs to use in the loyalty account search.

This cannot be combined with `mappings`.

Max: 30 customer IDs | + +## Example (as JSON) + +```json +{ + "mappings": [ + { + "id": "id8", + "created_at": "created_at6", + "phone_number": "phone_number4" + }, + { + "id": "id8", + "created_at": "created_at6", + "phone_number": "phone_number4" + }, + { + "id": "id8", + "created_at": "created_at6", + "phone_number": "phone_number4" + } + ], + "customer_ids": [ + "customer_ids5", + "customer_ids4", + "customer_ids3" + ] +} +``` + diff --git a/legacy/doc/models/search-loyalty-accounts-request.md b/legacy/doc/models/search-loyalty-accounts-request.md new file mode 100644 index 000000000..302f2f19b --- /dev/null +++ b/legacy/doc/models/search-loyalty-accounts-request.md @@ -0,0 +1,40 @@ + +# Search Loyalty Accounts Request + +A request to search for loyalty accounts. + +## Structure + +`SearchLoyaltyAccountsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `query` | [`SearchLoyaltyAccountsRequestLoyaltyAccountQuery \| undefined`](../../doc/models/search-loyalty-accounts-request-loyalty-account-query.md) | Optional | The search criteria for the loyalty accounts. | +| `limit` | `number \| undefined` | Optional | The maximum number of results to include in the response. The default value is 30.
**Constraints**: `>= 1`, `<= 200` | +| `cursor` | `string \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "limit": 10, + "query": { + "mappings": [ + { + "phone_number": "+14155551234", + "id": "id8", + "created_at": "created_at6" + } + ], + "customer_ids": [ + "customer_ids1", + "customer_ids2", + "customer_ids3" + ] + }, + "cursor": "cursor0" +} +``` + diff --git a/legacy/doc/models/search-loyalty-accounts-response.md b/legacy/doc/models/search-loyalty-accounts-response.md new file mode 100644 index 000000000..8c30a6773 --- /dev/null +++ b/legacy/doc/models/search-loyalty-accounts-response.md @@ -0,0 +1,56 @@ + +# Search Loyalty Accounts Response + +A response that includes loyalty accounts that satisfy the search criteria. + +## Structure + +`SearchLoyaltyAccountsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `loyaltyAccounts` | [`LoyaltyAccount[] \| undefined`](../../doc/models/loyalty-account.md) | Optional | The loyalty accounts that met the search criteria,
in order of creation date. | +| `cursor` | `string \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "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", + "enrolled_at": "enrolled_at4" + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "cursor": "cursor8" +} +``` + diff --git a/legacy/doc/models/search-loyalty-events-request.md b/legacy/doc/models/search-loyalty-events-request.md new file mode 100644 index 000000000..591c3065a --- /dev/null +++ b/legacy/doc/models/search-loyalty-events-request.md @@ -0,0 +1,56 @@ + +# Search Loyalty Events Request + +A request to search for loyalty events. + +## Structure + +`SearchLoyaltyEventsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `query` | [`LoyaltyEventQuery \| undefined`](../../doc/models/loyalty-event-query.md) | Optional | Represents a query used to search for loyalty events. | +| `limit` | `number \| undefined` | Optional | The maximum number of results to include in the response.
The last page might contain fewer events.
The default is 30 events.
**Constraints**: `>= 1`, `<= 30` | +| `cursor` | `string \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "limit": 30, + "query": { + "filter": { + "order_filter": { + "order_id": "PyATxhYLfsMqpVkcKJITPydgEYfZY" + }, + "loyalty_account_filter": { + "loyalty_account_id": "loyalty_account_id8" + }, + "type_filter": { + "types": [ + "ACCUMULATE_PROMOTION_POINTS", + "ACCUMULATE_POINTS", + "CREATE_REWARD" + ] + }, + "date_time_filter": { + "created_at": { + "start_at": "start_at4", + "end_at": "end_at8" + } + }, + "location_filter": { + "location_ids": [ + "location_ids0", + "location_ids1", + "location_ids2" + ] + } + } + }, + "cursor": "cursor8" +} +``` + diff --git a/legacy/doc/models/search-loyalty-events-response.md b/legacy/doc/models/search-loyalty-events-response.md new file mode 100644 index 000000000..97d48339a --- /dev/null +++ b/legacy/doc/models/search-loyalty-events-response.md @@ -0,0 +1,146 @@ + +# Search Loyalty Events Response + +A response that contains loyalty events that satisfy the search +criteria, in order by the `created_at` date. + +## Structure + +`SearchLoyaltyEventsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `events` | [`LoyaltyEvent[] \| undefined`](../../doc/models/loyalty-event.md) | Optional | The loyalty events that satisfy the search criteria. | +| `cursor` | `string \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "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", + "create_reward": { + "loyalty_program_id": "loyalty_program_id2", + "reward_id": "reward_id6", + "points": 90 + }, + "redeem_reward": { + "loyalty_program_id": "loyalty_program_id8", + "reward_id": "reward_id2", + "order_id": "order_id8" + }, + "delete_reward": { + "loyalty_program_id": "loyalty_program_id4", + "reward_id": "reward_id8", + "points": 104 + }, + "adjust_points": { + "loyalty_program_id": "loyalty_program_id2", + "points": 96, + "reason": "reason2" + } + }, + { + "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", + "accumulate_points": { + "loyalty_program_id": "loyalty_program_id8", + "points": 118, + "order_id": "order_id8" + }, + "create_reward": { + "loyalty_program_id": "loyalty_program_id2", + "reward_id": "reward_id6", + "points": 90 + }, + "delete_reward": { + "loyalty_program_id": "loyalty_program_id4", + "reward_id": "reward_id8", + "points": 104 + }, + "adjust_points": { + "loyalty_program_id": "loyalty_program_id2", + "points": 96, + "reason": "reason2" + } + }, + { + "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", + "accumulate_points": { + "loyalty_program_id": "loyalty_program_id8", + "points": 118, + "order_id": "order_id8" + }, + "redeem_reward": { + "loyalty_program_id": "loyalty_program_id8", + "reward_id": "reward_id2", + "order_id": "order_id8" + }, + "delete_reward": { + "loyalty_program_id": "loyalty_program_id4", + "reward_id": "reward_id8", + "points": 104 + }, + "adjust_points": { + "loyalty_program_id": "loyalty_program_id2", + "points": 96, + "reason": "reason2" + } + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "cursor": "cursor4" +} +``` + diff --git a/legacy/doc/models/search-loyalty-rewards-request-loyalty-reward-query.md b/legacy/doc/models/search-loyalty-rewards-request-loyalty-reward-query.md new file mode 100644 index 000000000..b30960bbf --- /dev/null +++ b/legacy/doc/models/search-loyalty-rewards-request-loyalty-reward-query.md @@ -0,0 +1,25 @@ + +# Search Loyalty Rewards Request Loyalty Reward Query + +The set of search requirements. + +## Structure + +`SearchLoyaltyRewardsRequestLoyaltyRewardQuery` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `loyaltyAccountId` | `string` | Required | The ID of the [loyalty account](entity:LoyaltyAccount) to which the loyalty reward belongs.
**Constraints**: *Minimum Length*: `1` | +| `status` | [`string \| undefined`](../../doc/models/loyalty-reward-status.md) | Optional | The status of the loyalty reward. | + +## Example (as JSON) + +```json +{ + "loyalty_account_id": "loyalty_account_id2", + "status": "DELETED" +} +``` + diff --git a/legacy/doc/models/search-loyalty-rewards-request.md b/legacy/doc/models/search-loyalty-rewards-request.md new file mode 100644 index 000000000..08e50c0cd --- /dev/null +++ b/legacy/doc/models/search-loyalty-rewards-request.md @@ -0,0 +1,30 @@ + +# Search Loyalty Rewards Request + +A request to search for loyalty rewards. + +## Structure + +`SearchLoyaltyRewardsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `query` | [`SearchLoyaltyRewardsRequestLoyaltyRewardQuery \| undefined`](../../doc/models/search-loyalty-rewards-request-loyalty-reward-query.md) | Optional | The set of search requirements. | +| `limit` | `number \| undefined` | Optional | The maximum number of results to return in the response. The default value is 30.
**Constraints**: `>= 1`, `<= 30` | +| `cursor` | `string \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "limit": 10, + "query": { + "loyalty_account_id": "5adcb100-07f1-4ee7-b8c6-6bb9ebc474bd", + "status": "ISSUED" + }, + "cursor": "cursor4" +} +``` + diff --git a/legacy/doc/models/search-loyalty-rewards-response.md b/legacy/doc/models/search-loyalty-rewards-response.md new file mode 100644 index 000000000..a9a442054 --- /dev/null +++ b/legacy/doc/models/search-loyalty-rewards-response.md @@ -0,0 +1,89 @@ + +# Search Loyalty Rewards Response + +A response that includes the loyalty rewards satisfying the search criteria. + +## Structure + +`SearchLoyaltyRewardsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `rewards` | [`LoyaltyReward[] \| undefined`](../../doc/models/loyalty-reward.md) | Optional | The loyalty rewards that satisfy the search criteria.
These are returned in descending order by `updated_at`. | +| `cursor` | `string \| undefined` | Optional | The pagination cursor to be used in a subsequent
request. If empty, this is the final response. | + +## Example (as JSON) + +```json +{ + "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", + "order_id": "order_id4" + }, + { + "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" + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "cursor": "cursor4" +} +``` + diff --git a/legacy/doc/models/search-orders-customer-filter.md b/legacy/doc/models/search-orders-customer-filter.md new file mode 100644 index 000000000..b773e6e65 --- /dev/null +++ b/legacy/doc/models/search-orders-customer-filter.md @@ -0,0 +1,29 @@ + +# Search Orders Customer Filter + +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](../../doc/models/fulfillment-recipient.md) `customer_id`. + +## Structure + +`SearchOrdersCustomerFilter` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customerIds` | `string[] \| null \| undefined` | Optional | A list of customer IDs to filter by.

Max: 10 customer ids. | + +## Example (as JSON) + +```json +{ + "customer_ids": [ + "customer_ids9", + "customer_ids0", + "customer_ids1" + ] +} +``` + diff --git a/legacy/doc/models/search-orders-date-time-filter.md b/legacy/doc/models/search-orders-date-time-filter.md new file mode 100644 index 000000000..a5bc34881 --- /dev/null +++ b/legacy/doc/models/search-orders-date-time-filter.md @@ -0,0 +1,49 @@ + +# Search Orders Date Time Filter + +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](../../doc/models/search-orders-sort.md) +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) + +## Structure + +`SearchOrdersDateTimeFilter` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `createdAt` | [`TimeRange \| undefined`](../../doc/models/time-range.md) | Optional | 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. | +| `updatedAt` | [`TimeRange \| undefined`](../../doc/models/time-range.md) | Optional | 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. | +| `closedAt` | [`TimeRange \| undefined`](../../doc/models/time-range.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "created_at": { + "start_at": "start_at4", + "end_at": "end_at8" + }, + "updated_at": { + "start_at": "start_at6", + "end_at": "end_at6" + }, + "closed_at": { + "start_at": "start_at4", + "end_at": "end_at8" + } +} +``` + diff --git a/legacy/doc/models/search-orders-filter.md b/legacy/doc/models/search-orders-filter.md new file mode 100644 index 000000000..58a8462a1 --- /dev/null +++ b/legacy/doc/models/search-orders-filter.md @@ -0,0 +1,67 @@ + +# Search Orders Filter + +Filtering criteria to use for a `SearchOrders` request. Multiple filters +are ANDed together. + +## Structure + +`SearchOrdersFilter` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `stateFilter` | [`SearchOrdersStateFilter \| undefined`](../../doc/models/search-orders-state-filter.md) | Optional | Filter by the current order `state`. | +| `dateTimeFilter` | [`SearchOrdersDateTimeFilter \| undefined`](../../doc/models/search-orders-date-time-filter.md) | Optional | 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](../../doc/models/search-orders-sort.md)
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) | +| `fulfillmentFilter` | [`SearchOrdersFulfillmentFilter \| undefined`](../../doc/models/search-orders-fulfillment-filter.md) | Optional | Filter based on [order fulfillment](../../doc/models/fulfillment.md) information. | +| `sourceFilter` | [`SearchOrdersSourceFilter \| undefined`](../../doc/models/search-orders-source-filter.md) | Optional | A filter based on order `source` information. | +| `customerFilter` | [`SearchOrdersCustomerFilter \| undefined`](../../doc/models/search-orders-customer-filter.md) | Optional | 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](../../doc/models/fulfillment-recipient.md) `customer_id`. | + +## Example (as JSON) + +```json +{ + "state_filter": { + "states": [ + "CANCELED", + "DRAFT" + ] + }, + "date_time_filter": { + "created_at": { + "start_at": "start_at4", + "end_at": "end_at8" + }, + "updated_at": { + "start_at": "start_at6", + "end_at": "end_at6" + }, + "closed_at": { + "start_at": "start_at4", + "end_at": "end_at8" + } + }, + "fulfillment_filter": { + "fulfillment_types": [ + "DELIVERY" + ], + "fulfillment_states": [ + "CANCELED", + "FAILED" + ] + }, + "source_filter": { + "source_names": [ + "source_names6" + ] + }, + "customer_filter": { + "customer_ids": [ + "customer_ids3", + "customer_ids4" + ] + } +} +``` + diff --git a/legacy/doc/models/search-orders-fulfillment-filter.md b/legacy/doc/models/search-orders-fulfillment-filter.md new file mode 100644 index 000000000..739f9ae70 --- /dev/null +++ b/legacy/doc/models/search-orders-fulfillment-filter.md @@ -0,0 +1,30 @@ + +# Search Orders Fulfillment Filter + +Filter based on [order fulfillment](../../doc/models/fulfillment.md) information. + +## Structure + +`SearchOrdersFulfillmentFilter` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `fulfillmentTypes` | [`string[] \| null \| undefined`](../../doc/models/fulfillment-type.md) | Optional | 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 | +| `fulfillmentStates` | [`string[] \| null \| undefined`](../../doc/models/fulfillment-state.md) | Optional | 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 | + +## Example (as JSON) + +```json +{ + "fulfillment_types": [ + "PICKUP", + "SHIPMENT" + ], + "fulfillment_states": [ + "PROPOSED" + ] +} +``` + diff --git a/legacy/doc/models/search-orders-query.md b/legacy/doc/models/search-orders-query.md new file mode 100644 index 000000000..84e5ede74 --- /dev/null +++ b/legacy/doc/models/search-orders-query.md @@ -0,0 +1,69 @@ + +# Search Orders Query + +Contains query criteria for the search. + +## Structure + +`SearchOrdersQuery` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `filter` | [`SearchOrdersFilter \| undefined`](../../doc/models/search-orders-filter.md) | Optional | Filtering criteria to use for a `SearchOrders` request. Multiple filters
are ANDed together. | +| `sort` | [`SearchOrdersSort \| undefined`](../../doc/models/search-orders-sort.md) | Optional | Sorting criteria for a `SearchOrders` request. Results can only be sorted
by a timestamp field. | + +## Example (as JSON) + +```json +{ + "filter": { + "state_filter": { + "states": [ + "CANCELED", + "DRAFT" + ] + }, + "date_time_filter": { + "created_at": { + "start_at": "start_at4", + "end_at": "end_at8" + }, + "updated_at": { + "start_at": "start_at6", + "end_at": "end_at6" + }, + "closed_at": { + "start_at": "start_at4", + "end_at": "end_at8" + } + }, + "fulfillment_filter": { + "fulfillment_types": [ + "DELIVERY" + ], + "fulfillment_states": [ + "CANCELED", + "FAILED" + ] + }, + "source_filter": { + "source_names": [ + "source_names6" + ] + }, + "customer_filter": { + "customer_ids": [ + "customer_ids3", + "customer_ids4" + ] + } + }, + "sort": { + "sort_field": "UPDATED_AT", + "sort_order": "DESC" + } +} +``` + diff --git a/legacy/doc/models/search-orders-request.md b/legacy/doc/models/search-orders-request.md new file mode 100644 index 000000000..596703e77 --- /dev/null +++ b/legacy/doc/models/search-orders-request.md @@ -0,0 +1,78 @@ + +# Search Orders Request + +## Structure + +`SearchOrdersRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationIds` | `string[] \| undefined` | Optional | The location IDs for the orders to query. All locations must belong to
the same merchant.

Max: 10 location IDs. | +| `cursor` | `string \| undefined` | Optional | 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` | [`SearchOrdersQuery \| undefined`](../../doc/models/search-orders-query.md) | Optional | Contains query criteria for the search. | +| `limit` | `number \| undefined` | Optional | The maximum number of results to be returned in a single page.

Default: `500`
Max: `1000` | +| `returnEntries` | `boolean \| undefined` | Optional | 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`. | + +## Example (as JSON) + +```json +{ + "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" + }, + "created_at": { + "start_at": "start_at4", + "end_at": "end_at8" + }, + "updated_at": { + "start_at": "start_at6", + "end_at": "end_at6" + } + }, + "state_filter": { + "states": [ + "COMPLETED" + ] + }, + "fulfillment_filter": { + "fulfillment_types": [ + "DELIVERY" + ], + "fulfillment_states": [ + "CANCELED", + "FAILED" + ] + }, + "source_filter": { + "source_names": [ + "source_names6" + ] + }, + "customer_filter": { + "customer_ids": [ + "customer_ids3", + "customer_ids4" + ] + } + }, + "sort": { + "sort_field": "CLOSED_AT", + "sort_order": "DESC" + } + }, + "return_entries": true, + "cursor": "cursor4" +} +``` + diff --git a/legacy/doc/models/search-orders-response.md b/legacy/doc/models/search-orders-response.md new file mode 100644 index 000000000..1d69bd2ba --- /dev/null +++ b/legacy/doc/models/search-orders-response.md @@ -0,0 +1,225 @@ + +# Search Orders Response + +Either the `order_entries` or `orders` field is set, depending on whether +`return_entries` is set on the [SearchOrdersRequest](../../doc/api/orders.md#search-orders). + +## Structure + +`SearchOrdersResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `orderEntries` | [`OrderEntry[] \| undefined`](../../doc/models/order-entry.md) | Optional | 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` | [`Order[] \| undefined`](../../doc/models/order.md) | Optional | 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` | `string \| undefined` | Optional | 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` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | [Errors](entity:Error) encountered during the search. | + +## Example (as JSON) + +```json +{ + "cursor": "123", + "order_entries": [ + { + "location_id": "057P5VYJ4A5X1", + "order_id": "CAISEM82RcpmcFBM0TfOyiHV3es", + "version": 1 + }, + { + "location_id": "18YC4JDH91E1H", + "order_id": "CAISENgvlJ6jLWAzERDzjyHVybY", + "version": 182 + }, + { + "location_id": "057P5VYJ4A5X1", + "order_id": "CAISEM52YcpmcWAzERDOyiWS3ty", + "version": 182 + } + ], + "orders": [ + { + "id": "id2", + "location_id": "location_id6", + "reference_id": "reference_id0", + "source": { + "name": "name4" + }, + "customer_id": "customer_id0", + "line_items": [ + { + "uid": "uid8", + "name": "name8", + "quantity": "quantity4", + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note4", + "catalog_object_id": "catalog_object_id2" + }, + { + "uid": "uid8", + "name": "name8", + "quantity": "quantity4", + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note4", + "catalog_object_id": "catalog_object_id2" + } + ] + }, + { + "id": "id2", + "location_id": "location_id6", + "reference_id": "reference_id0", + "source": { + "name": "name4" + }, + "customer_id": "customer_id0", + "line_items": [ + { + "uid": "uid8", + "name": "name8", + "quantity": "quantity4", + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note4", + "catalog_object_id": "catalog_object_id2" + }, + { + "uid": "uid8", + "name": "name8", + "quantity": "quantity4", + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note4", + "catalog_object_id": "catalog_object_id2" + } + ] + }, + { + "id": "id2", + "location_id": "location_id6", + "reference_id": "reference_id0", + "source": { + "name": "name4" + }, + "customer_id": "customer_id0", + "line_items": [ + { + "uid": "uid8", + "name": "name8", + "quantity": "quantity4", + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note4", + "catalog_object_id": "catalog_object_id2" + }, + { + "uid": "uid8", + "name": "name8", + "quantity": "quantity4", + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note4", + "catalog_object_id": "catalog_object_id2" + } + ] + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/search-orders-sort-field.md b/legacy/doc/models/search-orders-sort-field.md new file mode 100644 index 000000000..6c556a9d6 --- /dev/null +++ b/legacy/doc/models/search-orders-sort-field.md @@ -0,0 +1,17 @@ + +# Search Orders Sort Field + +Specifies which timestamp to use to sort `SearchOrder` results. + +## Enumeration + +`SearchOrdersSortField` + +## Fields + +| Name | Description | +| --- | --- | +| `CREATED_AT` | The time when the order was created, in RFC-3339 format. If you are also
filtering for a time range in this query, you must set the `CREATED_AT`
field in your `DateTimeFilter`. | +| `UPDATED_AT` | The time when the order last updated, in RFC-3339 format. If you are also
filtering for a time range in this query, you must set the `UPDATED_AT`
field in your `DateTimeFilter`. | +| `CLOSED_AT` | The time when the order was closed, in RFC-3339 format. If you use this
value, you must also set a `StateFilter` with closed states. If you are also
filtering for a time range in this query, you must set the `CLOSED_AT`
field in your `DateTimeFilter`. | + diff --git a/legacy/doc/models/search-orders-sort.md b/legacy/doc/models/search-orders-sort.md new file mode 100644 index 000000000..77120ea24 --- /dev/null +++ b/legacy/doc/models/search-orders-sort.md @@ -0,0 +1,26 @@ + +# Search Orders Sort + +Sorting criteria for a `SearchOrders` request. Results can only be sorted +by a timestamp field. + +## Structure + +`SearchOrdersSort` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `sortField` | [`string`](../../doc/models/search-orders-sort-field.md) | Required | Specifies which timestamp to use to sort `SearchOrder` results. | +| `sortOrder` | [`string \| undefined`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | + +## Example (as JSON) + +```json +{ + "sort_field": "CREATED_AT", + "sort_order": "DESC" +} +``` + diff --git a/legacy/doc/models/search-orders-source-filter.md b/legacy/doc/models/search-orders-source-filter.md new file mode 100644 index 000000000..afcebddcb --- /dev/null +++ b/legacy/doc/models/search-orders-source-filter.md @@ -0,0 +1,27 @@ + +# Search Orders Source Filter + +A filter based on order `source` information. + +## Structure + +`SearchOrdersSourceFilter` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `sourceNames` | `string[] \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "source_names": [ + "source_names4", + "source_names5", + "source_names6" + ] +} +``` + diff --git a/legacy/doc/models/search-orders-state-filter.md b/legacy/doc/models/search-orders-state-filter.md new file mode 100644 index 000000000..f09e9b1b4 --- /dev/null +++ b/legacy/doc/models/search-orders-state-filter.md @@ -0,0 +1,27 @@ + +# Search Orders State Filter + +Filter by the current order `state`. + +## Structure + +`SearchOrdersStateFilter` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `states` | [`string[]`](../../doc/models/order-state.md) | Required | States to filter for.
See [OrderState](#type-orderstate) for possible values | + +## Example (as JSON) + +```json +{ + "states": [ + "CANCELED", + "DRAFT", + "OPEN" + ] +} +``` + diff --git a/legacy/doc/models/search-shifts-request.md b/legacy/doc/models/search-shifts-request.md new file mode 100644 index 000000000..ced630167 --- /dev/null +++ b/legacy/doc/models/search-shifts-request.md @@ -0,0 +1,57 @@ + +# Search Shifts Request + +A request for a filtered and sorted set of `Shift` objects. + +## Structure + +`SearchShiftsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `query` | [`ShiftQuery \| undefined`](../../doc/models/shift-query.md) | Optional | The parameters of a `Shift` search query, which includes filter and sort options. | +| `limit` | `number \| undefined` | Optional | The number of resources in a page (200 by default).
**Constraints**: `>= 1`, `<= 200` | +| `cursor` | `string \| undefined` | Optional | An opaque cursor for fetching the next page. | + +## Example (as JSON) + +```json +{ + "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" + }, + "location_ids": [ + "location_ids4" + ], + "employee_ids": [ + "employee_ids9" + ], + "status": "OPEN", + "start": { + "start_at": "start_at6", + "end_at": "end_at6" + }, + "end": { + "start_at": "start_at0", + "end_at": "end_at2" + } + }, + "sort": { + "field": "START_AT", + "order": "DESC" + } + }, + "cursor": "cursor2" +} +``` + diff --git a/legacy/doc/models/search-shifts-response.md b/legacy/doc/models/search-shifts-response.md new file mode 100644 index 000000000..fb0ae9220 --- /dev/null +++ b/legacy/doc/models/search-shifts-response.md @@ -0,0 +1,120 @@ + +# Search Shifts Response + +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. + +## Structure + +`SearchShiftsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `shifts` | [`Shift[] \| undefined`](../../doc/models/shift.md) | Optional | Shifts. | +| `cursor` | `string \| undefined` | Optional | An opaque cursor for fetching the next page. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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" + } + } + ], + "cursor": "cursor8", + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/search-subscriptions-filter.md b/legacy/doc/models/search-subscriptions-filter.md new file mode 100644 index 000000000..b35246094 --- /dev/null +++ b/legacy/doc/models/search-subscriptions-filter.md @@ -0,0 +1,39 @@ + +# Search Subscriptions Filter + +Represents a set of query expressions (filters) to narrow the scope of targeted subscriptions returned by +the [SearchSubscriptions](../../doc/api/subscriptions.md#search-subscriptions) endpoint. + +## Structure + +`SearchSubscriptionsFilter` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customerIds` | `string[] \| null \| undefined` | Optional | A filter to select subscriptions based on the subscribing customer IDs. | +| `locationIds` | `string[] \| null \| undefined` | Optional | A filter to select subscriptions based on the location. | +| `sourceNames` | `string[] \| null \| undefined` | Optional | A filter to select subscriptions based on the source application. | + +## Example (as JSON) + +```json +{ + "customer_ids": [ + "customer_ids1", + "customer_ids2" + ], + "location_ids": [ + "location_ids4", + "location_ids5", + "location_ids6" + ], + "source_names": [ + "source_names2", + "source_names3", + "source_names4" + ] +} +``` + diff --git a/legacy/doc/models/search-subscriptions-query.md b/legacy/doc/models/search-subscriptions-query.md new file mode 100644 index 000000000..61d043fb3 --- /dev/null +++ b/legacy/doc/models/search-subscriptions-query.md @@ -0,0 +1,34 @@ + +# Search Subscriptions Query + +Represents a query, consisting of specified query expressions, used to search for subscriptions. + +## Structure + +`SearchSubscriptionsQuery` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `filter` | [`SearchSubscriptionsFilter \| undefined`](../../doc/models/search-subscriptions-filter.md) | Optional | Represents a set of query expressions (filters) to narrow the scope of targeted subscriptions returned by
the [SearchSubscriptions](../../doc/api/subscriptions.md#search-subscriptions) endpoint. | + +## Example (as JSON) + +```json +{ + "filter": { + "customer_ids": [ + "customer_ids3", + "customer_ids2" + ], + "location_ids": [ + "location_ids4" + ], + "source_names": [ + "source_names2" + ] + } +} +``` + diff --git a/legacy/doc/models/search-subscriptions-request.md b/legacy/doc/models/search-subscriptions-request.md new file mode 100644 index 000000000..15a8cb24e --- /dev/null +++ b/legacy/doc/models/search-subscriptions-request.md @@ -0,0 +1,44 @@ + +# Search Subscriptions Request + +Defines input parameters in a request to the +[SearchSubscriptions](../../doc/api/subscriptions.md#search-subscriptions) endpoint. + +## Structure + +`SearchSubscriptionsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `cursor` | `string \| undefined` | Optional | 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` | `number \| undefined` | Optional | The upper limit on the number of subscriptions to return
in a paged response.
**Constraints**: `>= 1` | +| `query` | [`SearchSubscriptionsQuery \| undefined`](../../doc/models/search-subscriptions-query.md) | Optional | Represents a query, consisting of specified query expressions, used to search for subscriptions. | +| `include` | `string[] \| undefined` | Optional | An option to include related information in the response.

The supported values are:

- `actions`: to include scheduled actions on the targeted subscriptions. | + +## Example (as JSON) + +```json +{ + "query": { + "filter": { + "customer_ids": [ + "CHFGVKYY8RSV93M5KCYTG4PN0G" + ], + "location_ids": [ + "S8GWD5R9QB376" + ], + "source_names": [ + "My App" + ] + } + }, + "cursor": "cursor6", + "limit": 230, + "include": [ + "include8" + ] +} +``` + diff --git a/legacy/doc/models/search-subscriptions-response.md b/legacy/doc/models/search-subscriptions-response.md new file mode 100644 index 000000000..7280d508d --- /dev/null +++ b/legacy/doc/models/search-subscriptions-response.md @@ -0,0 +1,100 @@ + +# Search Subscriptions Response + +Defines output parameters in a response from the +[SearchSubscriptions](../../doc/api/subscriptions.md#search-subscriptions) endpoint. + +## Structure + +`SearchSubscriptionsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Errors encountered during the request. | +| `subscriptions` | [`Subscription[] \| undefined`](../../doc/models/subscription.md) | Optional | The subscriptions matching the specified query expressions. | +| `cursor` | `string \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "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 + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "cursor": "cursor2" +} +``` + diff --git a/legacy/doc/models/search-team-members-filter.md b/legacy/doc/models/search-team-members-filter.md new file mode 100644 index 000000000..4f504fe2a --- /dev/null +++ b/legacy/doc/models/search-team-members-filter.md @@ -0,0 +1,37 @@ + +# Search Team Members Filter + +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". + +## Structure + +`SearchTeamMembersFilter` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationIds` | `string[] \| null \| undefined` | Optional | When present, filters by team members assigned to the specified locations.
When empty, includes team members assigned to any location. | +| `status` | [`string \| undefined`](../../doc/models/team-member-status.md) | Optional | Enumerates the possible statuses the team member can have within a business. | +| `isOwner` | `boolean \| null \| undefined` | Optional | When present and set to true, returns the team member who is the owner of the Square account. | + +## Example (as JSON) + +```json +{ + "location_ids": [ + "location_ids6" + ], + "status": "ACTIVE", + "is_owner": false +} +``` + diff --git a/legacy/doc/models/search-team-members-query.md b/legacy/doc/models/search-team-members-query.md new file mode 100644 index 000000000..29b6f4507 --- /dev/null +++ b/legacy/doc/models/search-team-members-query.md @@ -0,0 +1,29 @@ + +# Search Team Members Query + +Represents the parameters in a search for `TeamMember` objects. + +## Structure + +`SearchTeamMembersQuery` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `filter` | [`SearchTeamMembersFilter \| undefined`](../../doc/models/search-team-members-filter.md) | Optional | 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". | + +## Example (as JSON) + +```json +{ + "filter": { + "location_ids": [ + "location_ids4" + ], + "status": "ACTIVE", + "is_owner": false + } +} +``` + diff --git a/legacy/doc/models/search-team-members-request.md b/legacy/doc/models/search-team-members-request.md new file mode 100644 index 000000000..8fda961f8 --- /dev/null +++ b/legacy/doc/models/search-team-members-request.md @@ -0,0 +1,35 @@ + +# Search Team Members Request + +Represents a search request for a filtered list of `TeamMember` objects. + +## Structure + +`SearchTeamMembersRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `query` | [`SearchTeamMembersQuery \| undefined`](../../doc/models/search-team-members-query.md) | Optional | Represents the parameters in a search for `TeamMember` objects. | +| `limit` | `number \| undefined` | Optional | The maximum number of `TeamMember` objects in a page (100 by default).
**Constraints**: `>= 1`, `<= 200` | +| `cursor` | `string \| undefined` | Optional | The opaque cursor for fetching the next page. For more information, see
[pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | + +## Example (as JSON) + +```json +{ + "limit": 10, + "query": { + "filter": { + "location_ids": [ + "0G5P3VGACMMQZ" + ], + "status": "ACTIVE", + "is_owner": false + } + }, + "cursor": "cursor8" +} +``` + diff --git a/legacy/doc/models/search-team-members-response.md b/legacy/doc/models/search-team-members-response.md new file mode 100644 index 000000000..85aeabeca --- /dev/null +++ b/legacy/doc/models/search-team-members-response.md @@ -0,0 +1,284 @@ + +# Search Team Members Response + +Represents a response from a search request containing a filtered list of `TeamMember` objects. + +## Structure + +`SearchTeamMembersResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `teamMembers` | [`TeamMember[] \| undefined`](../../doc/models/team-member.md) | Optional | The filtered list of `TeamMember` objects. | +| `cursor` | `string \| undefined` | Optional | The opaque cursor for fetching the next page. For more information, see
[pagination](https://developer.squareup.com/docs/working-with-apis/pagination). | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | The errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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 + }, + "reference_id": "reference_id4" + }, + { + "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", + "reference_id": "reference_id4" + }, + { + "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", + "reference_id": "reference_id4" + }, + { + "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 + }, + "reference_id": "reference_id4" + }, + { + "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", + "reference_id": "reference_id4" + }, + { + "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", + "reference_id": "reference_id4" + }, + { + "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", + "reference_id": "reference_id4" + }, + { + "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 + }, + "reference_id": "reference_id4" + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/search-terminal-actions-request.md b/legacy/doc/models/search-terminal-actions-request.md new file mode 100644 index 000000000..a955205c1 --- /dev/null +++ b/legacy/doc/models/search-terminal-actions-request.md @@ -0,0 +1,38 @@ + +# Search Terminal Actions Request + +## Structure + +`SearchTerminalActionsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `query` | [`TerminalActionQuery \| undefined`](../../doc/models/terminal-action-query.md) | Optional | - | +| `cursor` | `string \| undefined` | Optional | 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` | `number \| undefined` | Optional | Limit the number of results returned for a single request.
**Constraints**: `>= 1`, `<= 100` | + +## Example (as JSON) + +```json +{ + "limit": 2, + "query": { + "filter": { + "created_at": { + "start_at": "2022-04-01T00:00:00.000Z", + "end_at": "end_at8" + }, + "device_id": "device_id0", + "status": "status6", + "type": "SAVE_CARD" + }, + "sort": { + "sort_order": "DESC" + } + }, + "cursor": "cursor4" +} +``` + diff --git a/legacy/doc/models/search-terminal-actions-response.md b/legacy/doc/models/search-terminal-actions-response.md new file mode 100644 index 000000000..a2b849842 --- /dev/null +++ b/legacy/doc/models/search-terminal-actions-response.md @@ -0,0 +1,66 @@ + +# Search Terminal Actions Response + +## Structure + +`SearchTerminalActionsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | +| `action` | [`TerminalAction[] \| undefined`](../../doc/models/terminal-action.md) | Optional | The requested search result of `TerminalAction`s. | +| `cursor` | `string \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "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", + "cancel_reason": "TIMED_OUT" + }, + { + "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", + "cancel_reason": "TIMED_OUT" + } + ], + "cursor": "CURSOR", + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/search-terminal-checkouts-request.md b/legacy/doc/models/search-terminal-checkouts-request.md new file mode 100644 index 000000000..38b33f805 --- /dev/null +++ b/legacy/doc/models/search-terminal-checkouts-request.md @@ -0,0 +1,37 @@ + +# Search Terminal Checkouts Request + +## Structure + +`SearchTerminalCheckoutsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `query` | [`TerminalCheckoutQuery \| undefined`](../../doc/models/terminal-checkout-query.md) | Optional | - | +| `cursor` | `string \| undefined` | Optional | 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` | `number \| undefined` | Optional | Limits the number of results returned for a single request.
**Constraints**: `>= 1`, `<= 100` | + +## Example (as JSON) + +```json +{ + "limit": 2, + "query": { + "filter": { + "status": "COMPLETED", + "device_id": "device_id0", + "created_at": { + "start_at": "start_at4", + "end_at": "end_at8" + } + }, + "sort": { + "sort_order": "DESC" + } + }, + "cursor": "cursor4" +} +``` + diff --git a/legacy/doc/models/search-terminal-checkouts-response.md b/legacy/doc/models/search-terminal-checkouts-response.md new file mode 100644 index 000000000..d4f439c6c --- /dev/null +++ b/legacy/doc/models/search-terminal-checkouts-response.md @@ -0,0 +1,123 @@ + +# Search Terminal Checkouts Response + +## Structure + +`SearchTerminalCheckoutsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | +| `checkouts` | [`TerminalCheckout[] \| undefined`](../../doc/models/terminal-checkout.md) | Optional | The requested search result of `TerminalCheckout` objects. | +| `cursor` | `string \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "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, + "separate_tip_screen": false, + "custom_tip_field": false, + "tip_percentages": [ + 48 + ], + "smart_tipping": false + }, + "collect_signature": false, + "show_itemized_cart": false + }, + "id": "tsQPvzwBpMqqO", + "note": "A brief note", + "payment_ids": [ + "rXnhZzywrEk4vR6pw76fPZfgvaB" + ], + "reference_id": "id14467", + "status": "COMPLETED", + "updated_at": "2020-03-31T18:13:52.725Z", + "order_id": "order_id2", + "payment_options": { + "autocomplete": false, + "delay_duration": "delay_duration2", + "accept_partial_authorization": false, + "delay_action": "CANCEL" + } + }, + { + "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, + "separate_tip_screen": false, + "custom_tip_field": false, + "tip_percentages": [ + 48 + ], + "smart_tipping": false + }, + "collect_signature": false, + "show_itemized_cart": false + }, + "id": "XlOPTgcEhrbqO", + "note": "A brief note", + "payment_ids": [ + "VYBF861PaoKPP7Pih0TlbZiNvaB" + ], + "reference_id": "id41623", + "status": "COMPLETED", + "updated_at": "2020-03-31T18:08:41.635Z", + "order_id": "order_id2", + "payment_options": { + "autocomplete": false, + "delay_duration": "delay_duration2", + "accept_partial_authorization": false, + "delay_action": "CANCEL" + } + } + ], + "cursor": "RiTJqBoTuXlbLmmrPvEkX9iG7XnQ4W4RjGnH", + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/search-terminal-refunds-request.md b/legacy/doc/models/search-terminal-refunds-request.md new file mode 100644 index 000000000..82c272bd0 --- /dev/null +++ b/legacy/doc/models/search-terminal-refunds-request.md @@ -0,0 +1,37 @@ + +# Search Terminal Refunds Request + +## Structure + +`SearchTerminalRefundsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `query` | [`TerminalRefundQuery \| undefined`](../../doc/models/terminal-refund-query.md) | Optional | - | +| `cursor` | `string \| undefined` | Optional | 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` | `number \| undefined` | Optional | Limits the number of results returned for a single request.
**Constraints**: `>= 1`, `<= 100` | + +## Example (as JSON) + +```json +{ + "limit": 1, + "query": { + "filter": { + "status": "COMPLETED", + "device_id": "device_id0", + "created_at": { + "start_at": "start_at4", + "end_at": "end_at8" + } + }, + "sort": { + "sort_order": "sort_order8" + } + }, + "cursor": "cursor4" +} +``` + diff --git a/legacy/doc/models/search-terminal-refunds-response.md b/legacy/doc/models/search-terminal-refunds-response.md new file mode 100644 index 000000000..9a2f2d87a --- /dev/null +++ b/legacy/doc/models/search-terminal-refunds-response.md @@ -0,0 +1,72 @@ + +# Search Terminal Refunds Response + +## Structure + +`SearchTerminalRefundsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | +| `refunds` | [`TerminalRefund[] \| undefined`](../../doc/models/terminal-refund.md) | Optional | The requested search result of `TerminalRefund` objects. | +| `cursor` | `string \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "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" + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "cursor": "cursor8" +} +``` + diff --git a/legacy/doc/models/search-vendors-request-filter.md b/legacy/doc/models/search-vendors-request-filter.md new file mode 100644 index 000000000..219005f74 --- /dev/null +++ b/legacy/doc/models/search-vendors-request-filter.md @@ -0,0 +1,33 @@ + +# Search Vendors Request Filter + +Defines supported query expressions to search for vendors by. + +## Structure + +`SearchVendorsRequestFilter` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `string[] \| null \| undefined` | Optional | The names of the [Vendor](entity:Vendor) objects to retrieve. | +| `status` | [`string[] \| null \| undefined`](../../doc/models/vendor-status.md) | Optional | The statuses of the [Vendor](entity:Vendor) objects to retrieve.
See [VendorStatus](#type-vendorstatus) for possible values | + +## Example (as JSON) + +```json +{ + "name": [ + "name4", + "name5", + "name6" + ], + "status": [ + "ACTIVE", + "INACTIVE", + "ACTIVE" + ] +} +``` + diff --git a/legacy/doc/models/search-vendors-request-sort-field.md b/legacy/doc/models/search-vendors-request-sort-field.md new file mode 100644 index 000000000..11f90af3f --- /dev/null +++ b/legacy/doc/models/search-vendors-request-sort-field.md @@ -0,0 +1,16 @@ + +# Search Vendors Request Sort Field + +The field to sort the returned [Vendor](../../doc/models/vendor.md) objects by. + +## Enumeration + +`SearchVendorsRequestSortField` + +## Fields + +| Name | Description | +| --- | --- | +| `NAME` | To sort the result by the name of the [Vendor](../../doc/models/vendor.md) objects. | +| `CREATED_AT` | To sort the result by the creation time of the [Vendor](../../doc/models/vendor.md) objects. | + diff --git a/legacy/doc/models/search-vendors-request-sort.md b/legacy/doc/models/search-vendors-request-sort.md new file mode 100644 index 000000000..bda094938 --- /dev/null +++ b/legacy/doc/models/search-vendors-request-sort.md @@ -0,0 +1,25 @@ + +# Search Vendors Request Sort + +Defines a sorter used to sort results from [SearchVendors](../../doc/api/vendors.md#search-vendors). + +## Structure + +`SearchVendorsRequestSort` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `field` | [`string \| undefined`](../../doc/models/search-vendors-request-sort-field.md) | Optional | The field to sort the returned [Vendor](../../doc/models/vendor.md) objects by. | +| `order` | [`string \| undefined`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | + +## Example (as JSON) + +```json +{ + "field": "NAME", + "order": "DESC" +} +``` + diff --git a/legacy/doc/models/search-vendors-request.md b/legacy/doc/models/search-vendors-request.md new file mode 100644 index 000000000..e7e1ae91d --- /dev/null +++ b/legacy/doc/models/search-vendors-request.md @@ -0,0 +1,55 @@ + +# Search Vendors Request + +Represents an input into a call to [SearchVendors](../../doc/api/vendors.md#search-vendors). + +## Structure + +`SearchVendorsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `filter` | [`SearchVendorsRequestFilter \| undefined`](../../doc/models/search-vendors-request-filter.md) | Optional | Defines supported query expressions to search for vendors by. | +| `sort` | [`SearchVendorsRequestSort \| undefined`](../../doc/models/search-vendors-request-sort.md) | Optional | Defines a sorter used to sort results from [SearchVendors](../../doc/api/vendors.md#search-vendors). | +| `cursor` | `string \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "query": { + "filter": { + "name": [ + "Joe's Fresh Seafood", + "Hannah's Bakery" + ], + "status": [ + "ACTIVE" + ] + }, + "sort": { + "field": "CREATED_AT", + "order": "ASC" + } + }, + "filter": { + "name": [ + "name4", + "name5", + "name6" + ], + "status": [ + "ACTIVE", + "INACTIVE" + ] + }, + "sort": { + "field": "NAME", + "order": "DESC" + }, + "cursor": "cursor0" +} +``` + diff --git a/legacy/doc/models/search-vendors-response.md b/legacy/doc/models/search-vendors-response.md new file mode 100644 index 000000000..3d55256e8 --- /dev/null +++ b/legacy/doc/models/search-vendors-response.md @@ -0,0 +1,61 @@ + +# Search Vendors Response + +Represents an output from a call to [SearchVendors](../../doc/api/vendors.md#search-vendors). + +## Structure + +`SearchVendorsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Errors encountered when the request fails. | +| `vendors` | [`Vendor[] \| undefined`](../../doc/models/vendor.md) | Optional | The [Vendor](entity:Vendor) objects matching the specified search filter. | +| `cursor` | `string \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "vendors": [ + { + "id": "id8", + "created_at": "created_at6", + "updated_at": "updated_at4", + "name": "name8", + "address": { + "address_line_1": "address_line_16", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "locality": "locality6", + "sublocality": "sublocality6" + } + }, + { + "id": "id8", + "created_at": "created_at6", + "updated_at": "updated_at4", + "name": "name8", + "address": { + "address_line_1": "address_line_16", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "locality": "locality6", + "sublocality": "sublocality6" + } + } + ], + "cursor": "cursor8" +} +``` + diff --git a/legacy/doc/models/segment-filter.md b/legacy/doc/models/segment-filter.md new file mode 100644 index 000000000..0961ff1b6 --- /dev/null +++ b/legacy/doc/models/segment-filter.md @@ -0,0 +1,40 @@ + +# Segment Filter + +A query filter to search for buyer-accessible appointment segments by. + +## Structure + +`SegmentFilter` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `serviceVariationId` | `string` | Required | The ID of the [CatalogItemVariation](entity:CatalogItemVariation) object representing the service booked in this segment.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `36` | +| `teamMemberIdFilter` | [`FilterValue \| undefined`](../../doc/models/filter-value.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "service_variation_id": "service_variation_id0", + "team_member_id_filter": { + "all": [ + "all5", + "all6", + "all7" + ], + "any": [ + "any2", + "any3", + "any4" + ], + "none": [ + "none7", + "none8" + ] + } +} +``` + diff --git a/legacy/doc/models/select-option.md b/legacy/doc/models/select-option.md new file mode 100644 index 000000000..7eb0a1a13 --- /dev/null +++ b/legacy/doc/models/select-option.md @@ -0,0 +1,23 @@ + +# Select Option + +## Structure + +`SelectOption` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `referenceId` | `string` | Required | The reference id for the option.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `40` | +| `title` | `string` | Required | The title text that displays in the select option button.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `250` | + +## Example (as JSON) + +```json +{ + "reference_id": "reference_id6", + "title": "title8" +} +``` + diff --git a/legacy/doc/models/select-options.md b/legacy/doc/models/select-options.md new file mode 100644 index 000000000..e7a6d8c36 --- /dev/null +++ b/legacy/doc/models/select-options.md @@ -0,0 +1,35 @@ + +# Select Options + +## Structure + +`SelectOptions` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `title` | `string` | Required | The title text to display in the select flow on the Terminal.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `250` | +| `body` | `string` | Required | The body text to display in the select flow on the Terminal.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `10000` | +| `options` | [`SelectOption[]`](../../doc/models/select-option.md) | Required | Represents the buttons/options that should be displayed in the select flow on the Terminal. | +| `selectedOption` | [`SelectOption \| undefined`](../../doc/models/select-option.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "title": "title0", + "body": "body0", + "options": [ + { + "reference_id": "reference_id0", + "title": "title2" + } + ], + "selected_option": { + "reference_id": "reference_id6", + "title": "title8" + } +} +``` + diff --git a/legacy/doc/models/shift-filter-status.md b/legacy/doc/models/shift-filter-status.md new file mode 100644 index 000000000..988934df2 --- /dev/null +++ b/legacy/doc/models/shift-filter-status.md @@ -0,0 +1,16 @@ + +# Shift Filter Status + +Specifies the `status` of `Shift` records to be returned. + +## Enumeration + +`ShiftFilterStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `OPEN` | Shifts that have been started and not ended. | +| `CLOSED` | Shifts that have been started and ended. | + diff --git a/legacy/doc/models/shift-filter.md b/legacy/doc/models/shift-filter.md new file mode 100644 index 000000000..a96fe0c63 --- /dev/null +++ b/legacy/doc/models/shift-filter.md @@ -0,0 +1,48 @@ + +# Shift Filter + +Defines a filter used in a search for `Shift` records. `AND` logic is +used by Square's servers to apply each filter property specified. + +## Structure + +`ShiftFilter` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationIds` | `string[] \| null \| undefined` | Optional | Fetch shifts for the specified location. | +| `employeeIds` | `string[] \| null \| undefined` | Optional | Fetch shifts for the specified employees. DEPRECATED at version 2020-08-26. Use `team_member_ids` instead. | +| `status` | [`string \| undefined`](../../doc/models/shift-filter-status.md) | Optional | Specifies the `status` of `Shift` records to be returned. | +| `start` | [`TimeRange \| undefined`](../../doc/models/time-range.md) | Optional | 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. | +| `end` | [`TimeRange \| undefined`](../../doc/models/time-range.md) | Optional | 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. | +| `workday` | [`ShiftWorkday \| undefined`](../../doc/models/shift-workday.md) | Optional | 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. | +| `teamMemberIds` | `string[] \| null \| undefined` | Optional | Fetch shifts for the specified team members. Replaced `employee_ids` at version "2020-08-26". | + +## Example (as JSON) + +```json +{ + "location_ids": [ + "location_ids8", + "location_ids9", + "location_ids0" + ], + "employee_ids": [ + "employee_ids3", + "employee_ids4", + "employee_ids5" + ], + "status": "OPEN", + "start": { + "start_at": "start_at6", + "end_at": "end_at6" + }, + "end": { + "start_at": "start_at0", + "end_at": "end_at2" + } +} +``` + diff --git a/legacy/doc/models/shift-query.md b/legacy/doc/models/shift-query.md new file mode 100644 index 000000000..6a6ebdce1 --- /dev/null +++ b/legacy/doc/models/shift-query.md @@ -0,0 +1,44 @@ + +# Shift Query + +The parameters of a `Shift` search query, which includes filter and sort options. + +## Structure + +`ShiftQuery` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `filter` | [`ShiftFilter \| undefined`](../../doc/models/shift-filter.md) | Optional | Defines a filter used in a search for `Shift` records. `AND` logic is
used by Square's servers to apply each filter property specified. | +| `sort` | [`ShiftSort \| undefined`](../../doc/models/shift-sort.md) | Optional | Sets the sort order of search results. | + +## Example (as JSON) + +```json +{ + "filter": { + "location_ids": [ + "location_ids4" + ], + "employee_ids": [ + "employee_ids9" + ], + "status": "OPEN", + "start": { + "start_at": "start_at6", + "end_at": "end_at6" + }, + "end": { + "start_at": "start_at0", + "end_at": "end_at2" + } + }, + "sort": { + "field": "START_AT", + "order": "DESC" + } +} +``` + diff --git a/legacy/doc/models/shift-sort-field.md b/legacy/doc/models/shift-sort-field.md new file mode 100644 index 000000000..eefd8b5c3 --- /dev/null +++ b/legacy/doc/models/shift-sort-field.md @@ -0,0 +1,18 @@ + +# Shift Sort Field + +Enumerates the `Shift` fields to sort on. + +## Enumeration + +`ShiftSortField` + +## Fields + +| Name | Description | +| --- | --- | +| `START_AT` | The start date/time of a `Shift` | +| `END_AT` | The end date/time of a `Shift` | +| `CREATED_AT` | The date/time that a `Shift` is created | +| `UPDATED_AT` | The most recent date/time that a `Shift` is updated | + diff --git a/legacy/doc/models/shift-sort.md b/legacy/doc/models/shift-sort.md new file mode 100644 index 000000000..7bad70e43 --- /dev/null +++ b/legacy/doc/models/shift-sort.md @@ -0,0 +1,25 @@ + +# Shift Sort + +Sets the sort order of search results. + +## Structure + +`ShiftSort` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `field` | [`string \| undefined`](../../doc/models/shift-sort-field.md) | Optional | Enumerates the `Shift` fields to sort on. | +| `order` | [`string \| undefined`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | + +## Example (as JSON) + +```json +{ + "field": "START_AT", + "order": "DESC" +} +``` + diff --git a/legacy/doc/models/shift-status.md b/legacy/doc/models/shift-status.md new file mode 100644 index 000000000..dbeaf3c6c --- /dev/null +++ b/legacy/doc/models/shift-status.md @@ -0,0 +1,16 @@ + +# Shift Status + +Enumerates the possible status of a `Shift`. + +## Enumeration + +`ShiftStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `OPEN` | Employee started a work shift and the shift is not complete | +| `CLOSED` | Employee started and ended a work shift. | + diff --git a/legacy/doc/models/shift-wage.md b/legacy/doc/models/shift-wage.md new file mode 100644 index 000000000..4a72ce3a9 --- /dev/null +++ b/legacy/doc/models/shift-wage.md @@ -0,0 +1,32 @@ + +# Shift Wage + +The hourly wage rate used to compensate an employee for this shift. + +## Structure + +`ShiftWage` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `title` | `string \| null \| undefined` | Optional | The name of the job performed during this shift. | +| `hourlyRate` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `jobId` | `string \| undefined` | Optional | The id of the job performed during this shift. Square
labor-reporting UIs might group shifts together by id. This cannot be used to retrieve the job. | +| `tipEligible` | `boolean \| null \| undefined` | Optional | Whether team members are eligible for tips when working this job. | + +## Example (as JSON) + +```json +{ + "title": "title6", + "hourly_rate": { + "amount": 172, + "currency": "LAK" + }, + "job_id": "job_id2", + "tip_eligible": false +} +``` + diff --git a/legacy/doc/models/shift-workday-matcher.md b/legacy/doc/models/shift-workday-matcher.md new file mode 100644 index 000000000..3d87afa5f --- /dev/null +++ b/legacy/doc/models/shift-workday-matcher.md @@ -0,0 +1,17 @@ + +# Shift Workday Matcher + +Defines the logic used to apply a workday filter. + +## Enumeration + +`ShiftWorkdayMatcher` + +## Fields + +| Name | Description | +| --- | --- | +| `START_AT` | All shifts that start on or after the specified workday | +| `END_AT` | All shifts that end on or before the specified workday | +| `INTERSECTION` | All shifts that start between the start and end workdays (inclusive) | + diff --git a/legacy/doc/models/shift-workday.md b/legacy/doc/models/shift-workday.md new file mode 100644 index 000000000..a2a464fb7 --- /dev/null +++ b/legacy/doc/models/shift-workday.md @@ -0,0 +1,31 @@ + +# Shift Workday + +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. + +## Structure + +`ShiftWorkday` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `dateRange` | [`DateRange \| undefined`](../../doc/models/date-range.md) | Optional | A range defined by two dates. Used for filtering a query for Connect v2
objects that have date properties. | +| `matchShiftsBy` | [`string \| undefined`](../../doc/models/shift-workday-matcher.md) | Optional | Defines the logic used to apply a workday filter. | +| `defaultTimezone` | `string \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "date_range": { + "start_date": "start_date6", + "end_date": "end_date2" + }, + "match_shifts_by": "END_AT", + "default_timezone": "default_timezone2" +} +``` + diff --git a/legacy/doc/models/shift.md b/legacy/doc/models/shift.md new file mode 100644 index 000000000..95ba3fe01 --- /dev/null +++ b/legacy/doc/models/shift.md @@ -0,0 +1,52 @@ + +# Shift + +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. + +## Structure + +`Shift` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | The UUID for this object.
**Constraints**: *Maximum Length*: `255` | +| `employeeId` | `string \| null \| undefined` | Optional | The ID of the employee this shift belongs to. DEPRECATED at version 2020-08-26. Use `team_member_id` instead. | +| `locationId` | `string` | Required | The ID of the location this shift occurred at. The location should be based on
where the employee clocked in.
**Constraints**: *Minimum Length*: `1` | +| `timezone` | `string \| null \| undefined` | Optional | 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. | +| `startAt` | `string` | Required | RFC 3339; shifted to the location timezone + offset. Precision up to the
minute is respected; seconds are truncated.
**Constraints**: *Minimum Length*: `1` | +| `endAt` | `string \| null \| undefined` | Optional | RFC 3339; shifted to the timezone + offset. Precision up to the minute is
respected; seconds are truncated. | +| `wage` | [`ShiftWage \| undefined`](../../doc/models/shift-wage.md) | Optional | The hourly wage rate used to compensate an employee for this shift. | +| `breaks` | [`Break[] \| null \| undefined`](../../doc/models/break.md) | Optional | A list of all the paid or unpaid breaks that were taken during this shift. | +| `status` | [`string \| undefined`](../../doc/models/shift-status.md) | Optional | Enumerates the possible status of a `Shift`. | +| `version` | `number \| undefined` | Optional | 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. | +| `createdAt` | `string \| undefined` | Optional | A read-only timestamp in RFC 3339 format; presented in UTC. | +| `updatedAt` | `string \| undefined` | Optional | A read-only timestamp in RFC 3339 format; presented in UTC. | +| `teamMemberId` | `string \| null \| undefined` | Optional | The ID of the team member this shift belongs to. Replaced `employee_id` at version "2020-08-26". | +| `declaredCashTipMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "id": "id0", + "employee_id": "employee_id0", + "location_id": "location_id4", + "timezone": "timezone0", + "start_at": "start_at2", + "end_at": "end_at0", + "wage": { + "title": "title8", + "hourly_rate": { + "amount": 172, + "currency": "LAK" + }, + "job_id": "job_id0", + "tip_eligible": false + } +} +``` + diff --git a/legacy/doc/models/shipping-fee.md b/legacy/doc/models/shipping-fee.md new file mode 100644 index 000000000..8d7c248ef --- /dev/null +++ b/legacy/doc/models/shipping-fee.md @@ -0,0 +1,26 @@ + +# Shipping Fee + +## Structure + +`ShippingFee` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `string \| null \| undefined` | Optional | The name for the shipping fee. | +| `charge` | [`Money`](../../doc/models/money.md) | Required | 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. | + +## Example (as JSON) + +```json +{ + "name": "name6", + "charge": { + "amount": 80, + "currency": "TTD" + } +} +``` + diff --git a/legacy/doc/models/signature-image.md b/legacy/doc/models/signature-image.md new file mode 100644 index 000000000..08e33fe70 --- /dev/null +++ b/legacy/doc/models/signature-image.md @@ -0,0 +1,23 @@ + +# Signature Image + +## Structure + +`SignatureImage` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `imageType` | `string \| undefined` | Optional | The mime/type of the image data.
Use `image/png;base64` for png. | +| `data` | `string \| undefined` | Optional | The base64 representation of the image. | + +## Example (as JSON) + +```json +{ + "image_type": "image_type4", + "data": "data8" +} +``` + diff --git a/legacy/doc/models/signature-options.md b/legacy/doc/models/signature-options.md new file mode 100644 index 000000000..e452c535e --- /dev/null +++ b/legacy/doc/models/signature-options.md @@ -0,0 +1,38 @@ + +# Signature Options + +## Structure + +`SignatureOptions` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `title` | `string` | Required | The title text to display in the signature capture flow on the Terminal.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `250` | +| `body` | `string` | Required | The body text to display in the signature capture flow on the Terminal.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `10000` | +| `signature` | [`SignatureImage[] \| undefined`](../../doc/models/signature-image.md) | Optional | An image representation of the collected signature. | + +## Example (as JSON) + +```json +{ + "title": "title2", + "body": "body8", + "signature": [ + { + "image_type": "image_type4", + "data": "data8" + }, + { + "image_type": "image_type4", + "data": "data8" + }, + { + "image_type": "image_type4", + "data": "data8" + } + ] +} +``` + diff --git a/legacy/doc/models/site.md b/legacy/doc/models/site.md new file mode 100644 index 000000000..78b795482 --- /dev/null +++ b/legacy/doc/models/site.md @@ -0,0 +1,32 @@ + +# Site + +Represents a Square Online site, which is an online store for a Square seller. + +## Structure + +`Site` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | The Square-assigned ID of the site.
**Constraints**: *Maximum Length*: `32` | +| `siteTitle` | `string \| null \| undefined` | Optional | The title of the site. | +| `domain` | `string \| null \| undefined` | Optional | The domain of the site (without the protocol). For example, `mysite1.square.site`. | +| `isPublished` | `boolean \| null \| undefined` | Optional | Indicates whether the site is published. | +| `createdAt` | `string \| undefined` | Optional | The timestamp of when the site was created, in RFC 3339 format. | +| `updatedAt` | `string \| undefined` | Optional | The timestamp of when the site was last updated, in RFC 3339 format. | + +## Example (as JSON) + +```json +{ + "id": "id0", + "site_title": "site_title6", + "domain": "domain6", + "is_published": false, + "created_at": "created_at8" +} +``` + diff --git a/legacy/doc/models/snippet-response.md b/legacy/doc/models/snippet-response.md new file mode 100644 index 000000000..42486b33f --- /dev/null +++ b/legacy/doc/models/snippet-response.md @@ -0,0 +1,42 @@ + +# Snippet Response + +## Structure + +`SnippetResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `snippet` | [`Snippet \| undefined`](../../doc/models/snippet.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "snippet": { + "id": "id0", + "site_id": "site_id6", + "content": "content4", + "created_at": "created_at8", + "updated_at": "updated_at4" + } +} +``` + diff --git a/legacy/doc/models/snippet.md b/legacy/doc/models/snippet.md new file mode 100644 index 000000000..c987ee6c6 --- /dev/null +++ b/legacy/doc/models/snippet.md @@ -0,0 +1,31 @@ + +# Snippet + +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. + +## Structure + +`Snippet` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | The Square-assigned ID for the snippet.
**Constraints**: *Maximum Length*: `48` | +| `siteId` | `string \| undefined` | Optional | The ID of the site that contains the snippet. | +| `content` | `string` | Required | The snippet code, which can contain valid HTML, JavaScript, or both.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `65535` | +| `createdAt` | `string \| undefined` | Optional | The timestamp of when the snippet was initially added to the site, in RFC 3339 format. | +| `updatedAt` | `string \| undefined` | Optional | The timestamp of when the snippet was last updated on the site, in RFC 3339 format. | + +## Example (as JSON) + +```json +{ + "id": "id2", + "site_id": "site_id8", + "content": "content6", + "created_at": "created_at0", + "updated_at": "updated_at8" +} +``` + diff --git a/legacy/doc/models/sort-order.md b/legacy/doc/models/sort-order.md new file mode 100644 index 000000000..b9e77cbad --- /dev/null +++ b/legacy/doc/models/sort-order.md @@ -0,0 +1,16 @@ + +# Sort Order + +The order (e.g., chronological or alphabetical) in which results from a request are returned. + +## Enumeration + +`SortOrder` + +## Fields + +| Name | Description | +| --- | --- | +| `DESC` | The results are returned in descending (e.g., newest-first or Z-A) order. | +| `ASC` | The results are returned in ascending (e.g., oldest-first or A-Z) order. | + diff --git a/legacy/doc/models/source-application.md b/legacy/doc/models/source-application.md new file mode 100644 index 000000000..3acadfd21 --- /dev/null +++ b/legacy/doc/models/source-application.md @@ -0,0 +1,27 @@ + +# Source Application + +Represents information about the application used to generate a change. + +## Structure + +`SourceApplication` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `product` | [`string \| undefined`](../../doc/models/product.md) | Optional | Indicates the Square product used to generate a change. | +| `applicationId` | `string \| null \| undefined` | Optional | __Read only__ The Square-assigned ID of the application. This field is used only if the
[product](entity:Product) type is `EXTERNAL_API`. | +| `name` | `string \| null \| undefined` | Optional | __Read only__ The display name of the application
(for example, `"Custom Application"` or `"Square POS 4.74 for Android"`). | + +## Example (as JSON) + +```json +{ + "product": "INVOICES", + "application_id": "application_id0", + "name": "name4" +} +``` + diff --git a/legacy/doc/models/square-account-details.md b/legacy/doc/models/square-account-details.md new file mode 100644 index 000000000..0cf2fba47 --- /dev/null +++ b/legacy/doc/models/square-account-details.md @@ -0,0 +1,38 @@ + +# Square Account Details + +Additional details about Square Account payments. + +## Structure + +`SquareAccountDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `paymentSourceToken` | `string \| null \| undefined` | Optional | Unique identifier for the payment source used for this payment.
**Constraints**: *Maximum Length*: `255` | +| `errors` | [`Error[] \| null \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | + +## Example (as JSON) + +```json +{ + "payment_source_token": "payment_source_token8", + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/standard-unit-description-group.md b/legacy/doc/models/standard-unit-description-group.md new file mode 100644 index 000000000..3980cceed --- /dev/null +++ b/legacy/doc/models/standard-unit-description-group.md @@ -0,0 +1,68 @@ + +# Standard Unit Description Group + +Group of standard measurement units. + +## Structure + +`StandardUnitDescriptionGroup` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `standardUnitDescriptions` | [`StandardUnitDescription[] \| null \| undefined`](../../doc/models/standard-unit-description.md) | Optional | List of standard (non-custom) measurement units in this description group. | +| `languageCode` | `string \| null \| undefined` | Optional | IETF language tag. | + +## Example (as JSON) + +```json +{ + "standard_unit_descriptions": [ + { + "unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_MILLILITER", + "weight_unit": "IMPERIAL_STONE" + }, + "name": "name4", + "abbreviation": "abbreviation6" + }, + { + "unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_MILLILITER", + "weight_unit": "IMPERIAL_STONE" + }, + "name": "name4", + "abbreviation": "abbreviation6" + }, + { + "unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_MILLILITER", + "weight_unit": "IMPERIAL_STONE" + }, + "name": "name4", + "abbreviation": "abbreviation6" + } + ], + "language_code": "language_code4" +} +``` + diff --git a/legacy/doc/models/standard-unit-description.md b/legacy/doc/models/standard-unit-description.md new file mode 100644 index 000000000..1fe0ec0ba --- /dev/null +++ b/legacy/doc/models/standard-unit-description.md @@ -0,0 +1,36 @@ + +# Standard Unit Description + +Contains the name and abbreviation for standard measurement unit. + +## Structure + +`StandardUnitDescription` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `unit` | [`MeasurementUnit \| undefined`](../../doc/models/measurement-unit.md) | Optional | 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`. | +| `name` | `string \| null \| undefined` | Optional | UI display name of the measurement unit. For example, 'Pound'. | +| `abbreviation` | `string \| null \| undefined` | Optional | UI display abbreviation for the measurement unit. For example, 'lb'. | + +## Example (as JSON) + +```json +{ + "unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_MILLILITER", + "weight_unit": "IMPERIAL_STONE" + }, + "name": "name4", + "abbreviation": "abbreviation6" +} +``` + diff --git a/legacy/doc/models/submit-evidence-response.md b/legacy/doc/models/submit-evidence-response.md new file mode 100644 index 000000000..a2b7ce7dd --- /dev/null +++ b/legacy/doc/models/submit-evidence-response.md @@ -0,0 +1,64 @@ + +# Submit Evidence Response + +Defines the fields in a `SubmitEvidence` response. + +## Structure + +`SubmitEvidenceResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | +| `dispute` | [`Dispute \| undefined`](../../doc/models/dispute.md) | Optional | Represents a [dispute](https://developer.squareup.com/docs/disputes-api/overview) a cardholder initiated with their bank. | + +## Example (as JSON) + +```json +{ + "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, + "dispute_id": "dispute_id8" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/subscription-action-type.md b/legacy/doc/models/subscription-action-type.md new file mode 100644 index 000000000..bff9f231a --- /dev/null +++ b/legacy/doc/models/subscription-action-type.md @@ -0,0 +1,19 @@ + +# Subscription Action Type + +Supported types of an action as a pending change to a subscription. + +## Enumeration + +`SubscriptionActionType` + +## Fields + +| Name | Description | +| --- | --- | +| `CANCEL` | The action to execute a scheduled cancellation of a subscription. | +| `PAUSE` | The action to execute a scheduled pause of a subscription. | +| `RESUME` | The action to execute a scheduled resumption of a subscription. | +| `SWAP_PLAN` | The action to execute a scheduled swap of a subscription plan in a subscription. | +| `CHANGE_BILLING_ANCHOR_DATE` | A billing anchor date change action. | + diff --git a/legacy/doc/models/subscription-action.md b/legacy/doc/models/subscription-action.md new file mode 100644 index 000000000..55ca63e93 --- /dev/null +++ b/legacy/doc/models/subscription-action.md @@ -0,0 +1,45 @@ + +# Subscription Action + +Represents an action as a pending change to a subscription. + +## Structure + +`SubscriptionAction` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | The ID of an action scoped to a subscription. | +| `type` | [`string \| undefined`](../../doc/models/subscription-action-type.md) | Optional | Supported types of an action as a pending change to a subscription. | +| `effectiveDate` | `string \| null \| undefined` | Optional | The `YYYY-MM-DD`-formatted date when the action occurs on the subscription. | +| `monthlyBillingAnchorDate` | `number \| null \| undefined` | Optional | The new billing anchor day value, for a `CHANGE_BILLING_ANCHOR_DATE` action. | +| `phases` | [`Phase[] \| null \| undefined`](../../doc/models/phase.md) | Optional | A list of Phases, to pass phase-specific information used in the swap. | +| `newPlanVariationId` | `string \| null \| undefined` | Optional | The target subscription plan variation that a subscription switches to, for a `SWAP_PLAN` action. | + +## Example (as JSON) + +```json +{ + "id": "id2", + "type": "SWAP_PLAN", + "effective_date": "effective_date2", + "monthly_billing_anchor_date": 18, + "phases": [ + { + "uid": "uid0", + "ordinal": 78, + "order_template_id": "order_template_id2", + "plan_phase_uid": "plan_phase_uid6" + }, + { + "uid": "uid0", + "ordinal": 78, + "order_template_id": "order_template_id2", + "plan_phase_uid": "plan_phase_uid6" + } + ] +} +``` + diff --git a/legacy/doc/models/subscription-cadence.md b/legacy/doc/models/subscription-cadence.md new file mode 100644 index 000000000..0499ca72a --- /dev/null +++ b/legacy/doc/models/subscription-cadence.md @@ -0,0 +1,27 @@ + +# Subscription Cadence + +Determines the billing cadence of a [Subscription](../../doc/models/subscription.md) + +## Enumeration + +`SubscriptionCadence` + +## Fields + +| Name | Description | +| --- | --- | +| `DAILY` | Once per day | +| `WEEKLY` | Once per week | +| `EVERY_TWO_WEEKS` | Every two weeks | +| `THIRTY_DAYS` | Once every 30 days | +| `SIXTY_DAYS` | Once every 60 days | +| `NINETY_DAYS` | Once every 90 days | +| `MONTHLY` | Once per month | +| `EVERY_TWO_MONTHS` | Once every two months | +| `QUARTERLY` | Once every three months | +| `EVERY_FOUR_MONTHS` | Once every four months | +| `EVERY_SIX_MONTHS` | Once every six months | +| `ANNUAL` | Once per year | +| `EVERY_TWO_YEARS` | Once every two years | + diff --git a/legacy/doc/models/subscription-event-info-code.md b/legacy/doc/models/subscription-event-info-code.md new file mode 100644 index 000000000..de7baf133 --- /dev/null +++ b/legacy/doc/models/subscription-event-info-code.md @@ -0,0 +1,20 @@ + +# Subscription Event Info Code + +Supported info codes of a subscription event. + +## Enumeration + +`SubscriptionEventInfoCode` + +## Fields + +| Name | Description | +| --- | --- | +| `LOCATION_NOT_ACTIVE` | The location is not active. | +| `LOCATION_CANNOT_ACCEPT_PAYMENT` | The location cannot accept payments. | +| `CUSTOMER_DELETED` | The subscribing customer profile has been deleted. | +| `CUSTOMER_NO_EMAIL` | The subscribing customer does not have an email. | +| `CUSTOMER_NO_NAME` | The subscribing customer does not have a name. | +| `USER_PROVIDED` | User-provided detail. | + diff --git a/legacy/doc/models/subscription-event-info.md b/legacy/doc/models/subscription-event-info.md new file mode 100644 index 000000000..91c74a94c --- /dev/null +++ b/legacy/doc/models/subscription-event-info.md @@ -0,0 +1,25 @@ + +# Subscription Event Info + +Provides information about the subscription event. + +## Structure + +`SubscriptionEventInfo` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `detail` | `string \| null \| undefined` | Optional | A human-readable explanation for the event. | +| `code` | [`string \| undefined`](../../doc/models/subscription-event-info-code.md) | Optional | Supported info codes of a subscription event. | + +## Example (as JSON) + +```json +{ + "detail": "detail8", + "code": "CUSTOMER_NO_NAME" +} +``` + diff --git a/legacy/doc/models/subscription-event-subscription-event-type.md b/legacy/doc/models/subscription-event-subscription-event-type.md new file mode 100644 index 000000000..8ca123a4e --- /dev/null +++ b/legacy/doc/models/subscription-event-subscription-event-type.md @@ -0,0 +1,21 @@ + +# Subscription Event Subscription Event Type + +Supported types of an event occurred to a subscription. + +## Enumeration + +`SubscriptionEventSubscriptionEventType` + +## Fields + +| Name | Description | +| --- | --- | +| `START_SUBSCRIPTION` | The subscription was started. | +| `PLAN_CHANGE` | The subscription plan was changed. | +| `STOP_SUBSCRIPTION` | The subscription was stopped. | +| `DEACTIVATE_SUBSCRIPTION` | The subscription was deactivated | +| `RESUME_SUBSCRIPTION` | The subscription was resumed. | +| `PAUSE_SUBSCRIPTION` | The subscription was paused. | +| `BILLING_ANCHOR_DATE_CHANGED` | The billing anchor date was changed. | + diff --git a/legacy/doc/models/subscription-event.md b/legacy/doc/models/subscription-event.md new file mode 100644 index 000000000..322c904de --- /dev/null +++ b/legacy/doc/models/subscription-event.md @@ -0,0 +1,51 @@ + +# Subscription Event + +Describes changes to a subscription and the subscription status. + +## Structure + +`SubscriptionEvent` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string` | Required | The ID of the subscription event. | +| `subscriptionEventType` | [`string`](../../doc/models/subscription-event-subscription-event-type.md) | Required | Supported types of an event occurred to a subscription. | +| `effectiveDate` | `string` | Required | The `YYYY-MM-DD`-formatted date (for example, 2013-01-15) when the subscription event occurred. | +| `monthlyBillingAnchorDate` | `number \| undefined` | Optional | The day-of-the-month the billing anchor date was changed to, if applicable. | +| `info` | [`SubscriptionEventInfo \| undefined`](../../doc/models/subscription-event-info.md) | Optional | Provides information about the subscription event. | +| `phases` | [`Phase[] \| null \| undefined`](../../doc/models/phase.md) | Optional | A list of Phases, to pass phase-specific information used in the swap. | +| `planVariationId` | `string` | Required | The ID of the subscription plan variation associated with the subscription. | + +## Example (as JSON) + +```json +{ + "id": "id6", + "subscription_event_type": "RESUME_SUBSCRIPTION", + "effective_date": "effective_date4", + "monthly_billing_anchor_date": 54, + "info": { + "detail": "detail6", + "code": "CUSTOMER_DELETED" + }, + "phases": [ + { + "uid": "uid0", + "ordinal": 78, + "order_template_id": "order_template_id2", + "plan_phase_uid": "plan_phase_uid6" + }, + { + "uid": "uid0", + "ordinal": 78, + "order_template_id": "order_template_id2", + "plan_phase_uid": "plan_phase_uid6" + } + ], + "plan_variation_id": "plan_variation_id0" +} +``` + diff --git a/legacy/doc/models/subscription-phase.md b/legacy/doc/models/subscription-phase.md new file mode 100644 index 000000000..95f92ec58 --- /dev/null +++ b/legacy/doc/models/subscription-phase.md @@ -0,0 +1,46 @@ + +# Subscription Phase + +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). + +## Structure + +`SubscriptionPhase` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `uid` | `string \| null \| undefined` | Optional | The Square-assigned ID of the subscription phase. This field cannot be changed after a `SubscriptionPhase` is created. | +| `cadence` | [`string`](../../doc/models/subscription-cadence.md) | Required | Determines the billing cadence of a [Subscription](../../doc/models/subscription.md) | +| `periods` | `number \| null \| undefined` | Optional | 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. | +| `recurringPriceMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `ordinal` | `bigint \| null \| undefined` | Optional | 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` | [`SubscriptionPricing \| undefined`](../../doc/models/subscription-pricing.md) | Optional | Describes the pricing for the subscription. | + +## Example (as JSON) + +```json +{ + "uid": "uid2", + "cadence": "EVERY_SIX_MONTHS", + "periods": 36, + "recurring_price_money": { + "amount": 66, + "currency": "ZMW" + }, + "ordinal": 2, + "pricing": { + "type": "STATIC", + "discount_ids": [ + "discount_ids5", + "discount_ids6" + ], + "price_money": { + "amount": 202, + "currency": "GTQ" + } + } +} +``` + diff --git a/legacy/doc/models/subscription-pricing-type.md b/legacy/doc/models/subscription-pricing-type.md new file mode 100644 index 000000000..105aa699b --- /dev/null +++ b/legacy/doc/models/subscription-pricing-type.md @@ -0,0 +1,16 @@ + +# Subscription Pricing Type + +Determines the pricing of a [Subscription](../../doc/models/subscription.md) + +## Enumeration + +`SubscriptionPricingType` + +## Fields + +| Name | Description | +| --- | --- | +| `STATIC` | Static pricing | +| `RELATIVE` | Relative pricing | + diff --git a/legacy/doc/models/subscription-pricing.md b/legacy/doc/models/subscription-pricing.md new file mode 100644 index 000000000..d24c668f2 --- /dev/null +++ b/legacy/doc/models/subscription-pricing.md @@ -0,0 +1,33 @@ + +# Subscription Pricing + +Describes the pricing for the subscription. + +## Structure + +`SubscriptionPricing` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `type` | [`string \| undefined`](../../doc/models/subscription-pricing-type.md) | Optional | Determines the pricing of a [Subscription](../../doc/models/subscription.md) | +| `discountIds` | `string[] \| null \| undefined` | Optional | The ids of the discount catalog objects | +| `priceMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "type": "STATIC", + "discount_ids": [ + "discount_ids9", + "discount_ids0" + ], + "price_money": { + "amount": 202, + "currency": "GTQ" + } +} +``` + diff --git a/legacy/doc/models/subscription-source.md b/legacy/doc/models/subscription-source.md new file mode 100644 index 000000000..14f73af1f --- /dev/null +++ b/legacy/doc/models/subscription-source.md @@ -0,0 +1,23 @@ + +# Subscription Source + +The origination details of the subscription. + +## Structure + +`SubscriptionSource` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `name` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `255` | + +## Example (as JSON) + +```json +{ + "name": "name0" +} +``` + diff --git a/legacy/doc/models/subscription-status.md b/legacy/doc/models/subscription-status.md new file mode 100644 index 000000000..8693d7868 --- /dev/null +++ b/legacy/doc/models/subscription-status.md @@ -0,0 +1,19 @@ + +# Subscription Status + +Supported subscription statuses. + +## Enumeration + +`SubscriptionStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `PENDING` | The subscription is pending to start in the future. | +| `ACTIVE` | The subscription is active. | +| `CANCELED` | The subscription is canceled. | +| `DEACTIVATED` | The subscription is deactivated. | +| `PAUSED` | The subscription is paused. | + diff --git a/legacy/doc/models/subscription-test-result.md b/legacy/doc/models/subscription-test-result.md new file mode 100644 index 000000000..92252d564 --- /dev/null +++ b/legacy/doc/models/subscription-test-result.md @@ -0,0 +1,32 @@ + +# Subscription Test Result + +Represents the details of a webhook subscription, including notification URL, +event types, and signature key. + +## Structure + +`SubscriptionTestResult` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | A Square-generated unique ID for the subscription test result.
**Constraints**: *Maximum Length*: `64` | +| `statusCode` | `number \| null \| undefined` | Optional | The status code returned by the subscription notification URL. | +| `payload` | `string \| null \| undefined` | Optional | An object containing the payload of the test event. For example, a `payment.created` event. | +| `createdAt` | `string \| undefined` | Optional | The timestamp of when the subscription was created, in RFC 3339 format.
For example, "2016-09-04T23:59:33.123Z". | +| `updatedAt` | `string \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "id": "id0", + "status_code": 208, + "payload": "payload6", + "created_at": "created_at8", + "updated_at": "updated_at4" +} +``` + diff --git a/legacy/doc/models/subscription.md b/legacy/doc/models/subscription.md new file mode 100644 index 000000000..dbdc965dc --- /dev/null +++ b/legacy/doc/models/subscription.md @@ -0,0 +1,48 @@ + +# Subscription + +Represents a subscription purchased by a customer. + +For more information, see +[Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). + +## Structure + +`Subscription` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | The Square-assigned ID of the subscription.
**Constraints**: *Maximum Length*: `255` | +| `locationId` | `string \| undefined` | Optional | The ID of the location associated with the subscription. | +| `planVariationId` | `string \| undefined` | Optional | The ID of the subscribed-to [subscription plan variation](entity:CatalogSubscriptionPlanVariation). | +| `customerId` | `string \| undefined` | Optional | The ID of the subscribing [customer](entity:Customer) profile. | +| `startDate` | `string \| undefined` | Optional | The `YYYY-MM-DD`-formatted date (for example, 2013-01-15) to start the subscription. | +| `canceledDate` | `string \| null \| undefined` | Optional | 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. | +| `chargedThroughDate` | `string \| undefined` | Optional | 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. | +| `status` | [`string \| undefined`](../../doc/models/subscription-status.md) | Optional | Supported subscription statuses. | +| `taxPercentage` | `string \| null \| undefined` | Optional | 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%. | +| `invoiceIds` | `string[] \| undefined` | Optional | The IDs of the [invoices](entity:Invoice) created for the
subscription, listed in order when the invoices were created
(newest invoices appear first). | +| `priceOverrideMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `version` | `bigint \| undefined` | Optional | 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. | +| `createdAt` | `string \| undefined` | Optional | The timestamp when the subscription was created, in RFC 3339 format. | +| `cardId` | `string \| null \| undefined` | Optional | The ID of the [subscriber's](entity:Customer) [card](entity:Card)
used to charge for the subscription. | +| `timezone` | `string \| undefined` | Optional | 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`). | +| `source` | [`SubscriptionSource \| undefined`](../../doc/models/subscription-source.md) | Optional | The origination details of the subscription. | +| `actions` | [`SubscriptionAction[] \| null \| undefined`](../../doc/models/subscription-action.md) | Optional | The list of scheduled actions on this subscription. It is set only in the response from
[RetrieveSubscription](../../doc/api/subscriptions.md#retrieve-subscription) with the query parameter
of `include=actions` or from
[SearchSubscriptions](../../doc/api/subscriptions.md#search-subscriptions) with the input parameter
of `include:["actions"]`. | +| `monthlyBillingAnchorDate` | `number \| undefined` | Optional | The day of the month on which the subscription will issue invoices and publish orders. | +| `phases` | [`Phase[] \| undefined`](../../doc/models/phase.md) | Optional | array of phases for this subscription | + +## Example (as JSON) + +```json +{ + "id": "id4", + "location_id": "location_id8", + "plan_variation_id": "plan_variation_id8", + "customer_id": "customer_id2", + "start_date": "start_date8" +} +``` + diff --git a/legacy/doc/models/swap-plan-request.md b/legacy/doc/models/swap-plan-request.md new file mode 100644 index 000000000..f698a9fb4 --- /dev/null +++ b/legacy/doc/models/swap-plan-request.md @@ -0,0 +1,31 @@ + +# Swap Plan Request + +Defines input parameters in a call to the +[SwapPlan](../../doc/api/subscriptions.md#swap-plan) endpoint. + +## Structure + +`SwapPlanRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `newPlanVariationId` | `string \| null \| undefined` | Optional | The ID of the new subscription plan variation.

This field is required. | +| `phases` | [`PhaseInput[] \| null \| undefined`](../../doc/models/phase-input.md) | Optional | A list of PhaseInputs, to pass phase-specific information used in the swap. | + +## Example (as JSON) + +```json +{ + "new_plan_variation_id": "FQ7CDXXWSLUJRPM3GFJSJGZ7", + "phases": [ + { + "order_template_id": "uhhnjH9osVv3shUADwaC0b3hNxQZY", + "ordinal": 0 + } + ] +} +``` + diff --git a/legacy/doc/models/swap-plan-response.md b/legacy/doc/models/swap-plan-response.md new file mode 100644 index 000000000..8a3ca6126 --- /dev/null +++ b/legacy/doc/models/swap-plan-response.md @@ -0,0 +1,88 @@ + +# Swap Plan Response + +Defines output parameters in a response of the +[SwapPlan](../../doc/api/subscriptions.md#swap-plan) endpoint. + +## Structure + +`SwapPlanResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Errors encountered during the request. | +| `subscription` | [`Subscription \| undefined`](../../doc/models/subscription.md) | Optional | Represents a subscription purchased by a customer.

For more information, see
[Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). | +| `actions` | [`SubscriptionAction[] \| undefined`](../../doc/models/subscription-action.md) | Optional | A list of a `SWAP_PLAN` action created by the request. | + +## Example (as JSON) + +```json +{ + "actions": [ + { + "effective_date": "2023-11-17", + "id": "f0a1dfdc-675b-3a14-a640-99f7ac1cee83", + "new_plan_variation_id": "FQ7CDXXWSLUJRPM3GFJSJGZ7", + "phases": [ + { + "order_template_id": "uhhnjH9osVv3shUADwaC0b3hNxQZY", + "ordinal": 0, + "uid": "uid0", + "plan_phase_uid": "plan_phase_uid6" + } + ], + "type": "SWAP_PLAN", + "monthly_billing_anchor_date": 186 + } + ], + "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, + "start_date": "start_date8" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/tax-calculation-phase.md b/legacy/doc/models/tax-calculation-phase.md new file mode 100644 index 000000000..314d812b8 --- /dev/null +++ b/legacy/doc/models/tax-calculation-phase.md @@ -0,0 +1,16 @@ + +# Tax Calculation Phase + +When to calculate the taxes due on a cart. + +## Enumeration + +`TaxCalculationPhase` + +## Fields + +| Name | Description | +| --- | --- | +| `TAX_SUBTOTAL_PHASE` | The fee is calculated based on the payment's subtotal. | +| `TAX_TOTAL_PHASE` | The fee is calculated based on the payment's total. | + diff --git a/legacy/doc/models/tax-ids.md b/legacy/doc/models/tax-ids.md new file mode 100644 index 000000000..dba7bceb0 --- /dev/null +++ b/legacy/doc/models/tax-ids.md @@ -0,0 +1,31 @@ + +# Tax Ids + +Identifiers for the location used by various governments for tax purposes. + +## Structure + +`TaxIds` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `euVat` | `string \| undefined` | Optional | 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. | +| `frSiret` | `string \| undefined` | Optional | 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`. | +| `frNaf` | `string \| undefined` | Optional | 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`. | +| `esNif` | `string \| undefined` | Optional | 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`. | +| `jpQii` | `string \| undefined` | Optional | The QII (Qualified Invoice Issuer) number is a 14-character tax identifier used in Japan.
For example, `T1234567890123`. | + +## Example (as JSON) + +```json +{ + "eu_vat": "eu_vat8", + "fr_siret": "fr_siret0", + "fr_naf": "fr_naf0", + "es_nif": "es_nif4", + "jp_qii": "jp_qii0" +} +``` + diff --git a/legacy/doc/models/tax-inclusion-type.md b/legacy/doc/models/tax-inclusion-type.md new file mode 100644 index 000000000..d8f3c0d76 --- /dev/null +++ b/legacy/doc/models/tax-inclusion-type.md @@ -0,0 +1,16 @@ + +# Tax Inclusion Type + +Whether to the tax amount should be additional to or included in the CatalogItem price. + +## Enumeration + +`TaxInclusionType` + +## Fields + +| Name | Description | +| --- | --- | +| `ADDITIVE` | The tax is an additive tax. The tax amount is added on top of the
CatalogItemVariation price. For example, a $1.00 item with a 10% additive
tax would have a total cost to the buyer of $1.10. | +| `INCLUSIVE` | The tax is an inclusive tax. The tax amount is included in the
CatalogItemVariation price. For example, a $1.00 item with a 10% inclusive
tax would have a total cost to the buyer of $1.00, with $0.91 (91 cents) of
that total being the cost of the item and $0.09 (9 cents) being tax. | + diff --git a/legacy/doc/models/team-member-assigned-locations-assignment-type.md b/legacy/doc/models/team-member-assigned-locations-assignment-type.md new file mode 100644 index 000000000..6f582ec60 --- /dev/null +++ b/legacy/doc/models/team-member-assigned-locations-assignment-type.md @@ -0,0 +1,16 @@ + +# Team Member Assigned Locations Assignment Type + +Enumerates the possible assignment types that the team member can have. + +## Enumeration + +`TeamMemberAssignedLocationsAssignmentType` + +## Fields + +| Name | Description | +| --- | --- | +| `ALL_CURRENT_AND_FUTURE_LOCATIONS` | The team member is assigned to all current and future locations. The `location_ids` field
is empty if the team member has this assignment type. | +| `EXPLICIT_LOCATIONS` | The team member is assigned to an explicit subset of locations. The `location_ids` field
is the list of locations that the team member is assigned to. | + diff --git a/legacy/doc/models/team-member-assigned-locations.md b/legacy/doc/models/team-member-assigned-locations.md new file mode 100644 index 000000000..39a8b54d7 --- /dev/null +++ b/legacy/doc/models/team-member-assigned-locations.md @@ -0,0 +1,28 @@ + +# Team Member Assigned Locations + +An object that represents a team member's assignment to locations. + +## Structure + +`TeamMemberAssignedLocations` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `assignmentType` | [`string \| undefined`](../../doc/models/team-member-assigned-locations-assignment-type.md) | Optional | Enumerates the possible assignment types that the team member can have. | +| `locationIds` | `string[] \| null \| undefined` | Optional | The explicit locations that the team member is assigned to. | + +## Example (as JSON) + +```json +{ + "assignment_type": "ALL_CURRENT_AND_FUTURE_LOCATIONS", + "location_ids": [ + "location_ids4", + "location_ids5" + ] +} +``` + diff --git a/legacy/doc/models/team-member-booking-profile.md b/legacy/doc/models/team-member-booking-profile.md new file mode 100644 index 000000000..fb3810313 --- /dev/null +++ b/legacy/doc/models/team-member-booking-profile.md @@ -0,0 +1,31 @@ + +# Team Member Booking Profile + +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. + +## Structure + +`TeamMemberBookingProfile` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `teamMemberId` | `string \| undefined` | Optional | The ID of the [TeamMember](entity:TeamMember) object for the team member associated with the booking profile.
**Constraints**: *Maximum Length*: `32` | +| `description` | `string \| undefined` | Optional | The description of the team member.
**Constraints**: *Maximum Length*: `65536` | +| `displayName` | `string \| undefined` | Optional | The display name of the team member.
**Constraints**: *Maximum Length*: `512` | +| `isBookable` | `boolean \| null \| undefined` | Optional | 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`). | +| `profileImageUrl` | `string \| undefined` | Optional | The URL of the team member's image for the bookings profile.
**Constraints**: *Maximum Length*: `2048` | + +## Example (as JSON) + +```json +{ + "team_member_id": "team_member_id0", + "description": "description0", + "display_name": "display_name0", + "is_bookable": false, + "profile_image_url": "profile_image_url6" +} +``` + diff --git a/legacy/doc/models/team-member-invitation-status.md b/legacy/doc/models/team-member-invitation-status.md new file mode 100644 index 000000000..cd18b4cb7 --- /dev/null +++ b/legacy/doc/models/team-member-invitation-status.md @@ -0,0 +1,17 @@ + +# Team Member Invitation Status + +Enumerates the possible invitation statuses the team member can have within a business. + +## Enumeration + +`TeamMemberInvitationStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `UNINVITED` | The team member has not received an invitation. | +| `PENDING` | The team member has received an invitation, but had not accepted it. | +| `ACCEPTED` | The team member has both received and accepted an invitation. | + diff --git a/legacy/doc/models/team-member-status.md b/legacy/doc/models/team-member-status.md new file mode 100644 index 000000000..93dacc258 --- /dev/null +++ b/legacy/doc/models/team-member-status.md @@ -0,0 +1,16 @@ + +# Team Member Status + +Enumerates the possible statuses the team member can have within a business. + +## Enumeration + +`TeamMemberStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `ACTIVE` | The team member can sign in to Point of Sale and the Seller Dashboard. | +| `INACTIVE` | The team member can no longer sign in to Point of Sale or the Seller Dashboard,
but the team member's sales reports remain available. | + diff --git a/legacy/doc/models/team-member-wage.md b/legacy/doc/models/team-member-wage.md new file mode 100644 index 000000000..cf9d818ff --- /dev/null +++ b/legacy/doc/models/team-member-wage.md @@ -0,0 +1,36 @@ + +# Team Member Wage + +The hourly wage rate that a team member earns on a `Shift` for doing the job +specified by the `title` property of this object. + +## Structure + +`TeamMemberWage` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | The UUID for this object. | +| `teamMemberId` | `string \| null \| undefined` | Optional | The `TeamMember` that this wage is assigned to. | +| `title` | `string \| null \| undefined` | Optional | The job title that this wage relates to. | +| `hourlyRate` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `jobId` | `string \| null \| undefined` | Optional | An identifier for the job that this wage relates to. This cannot be
used to retrieve the job. | +| `tipEligible` | `boolean \| null \| undefined` | Optional | Whether team members are eligible for tips when working this job. | + +## Example (as JSON) + +```json +{ + "id": "id2", + "team_member_id": "team_member_id2", + "title": "title8", + "hourly_rate": { + "amount": 172, + "currency": "LAK" + }, + "job_id": "job_id0" +} +``` + diff --git a/legacy/doc/models/team-member.md b/legacy/doc/models/team-member.md new file mode 100644 index 000000000..acdc7d679 --- /dev/null +++ b/legacy/doc/models/team-member.md @@ -0,0 +1,38 @@ + +# Team Member + +A record representing an individual team member for a business. + +## Structure + +`TeamMember` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | The unique ID for the team member. | +| `referenceId` | `string \| null \| undefined` | Optional | A second ID used to associate the team member with an entity in another system. | +| `isOwner` | `boolean \| undefined` | Optional | Whether the team member is the owner of the Square account. | +| `status` | [`string \| undefined`](../../doc/models/team-member-status.md) | Optional | Enumerates the possible statuses the team member can have within a business. | +| `givenName` | `string \| null \| undefined` | Optional | The given name (that is, the first name) associated with the team member. | +| `familyName` | `string \| null \| undefined` | Optional | The family name (that is, the last name) associated with the team member. | +| `emailAddress` | `string \| null \| undefined` | Optional | The email address associated with the team member. After accepting the invitation
from Square, only the team member can change this value. | +| `phoneNumber` | `string \| null \| undefined` | Optional | 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 | +| `createdAt` | `string \| undefined` | Optional | The timestamp when the team member was created, in RFC 3339 format. | +| `updatedAt` | `string \| undefined` | Optional | The timestamp when the team member was last updated, in RFC 3339 format. | +| `assignedLocations` | [`TeamMemberAssignedLocations \| undefined`](../../doc/models/team-member-assigned-locations.md) | Optional | An object that represents a team member's assignment to locations. | +| `wageSetting` | [`WageSetting \| undefined`](../../doc/models/wage-setting.md) | Optional | Represents information about the overtime exemption status, job assignments, and compensation
for a [team member](../../doc/models/team-member.md). | + +## Example (as JSON) + +```json +{ + "id": "id4", + "reference_id": "reference_id8", + "is_owner": false, + "status": "ACTIVE", + "given_name": "given_name6" +} +``` + diff --git a/legacy/doc/models/tender-bank-account-details-status.md b/legacy/doc/models/tender-bank-account-details-status.md new file mode 100644 index 000000000..29b0c1f16 --- /dev/null +++ b/legacy/doc/models/tender-bank-account-details-status.md @@ -0,0 +1,17 @@ + +# Tender Bank Account Details Status + +Indicates the bank account payment's current status. + +## Enumeration + +`TenderBankAccountDetailsStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `PENDING` | The bank account payment is in progress. | +| `COMPLETED` | The bank account payment has been completed. | +| `FAILED` | The bank account payment failed. | + diff --git a/legacy/doc/models/tender-bank-account-details.md b/legacy/doc/models/tender-bank-account-details.md new file mode 100644 index 000000000..8819dbc93 --- /dev/null +++ b/legacy/doc/models/tender-bank-account-details.md @@ -0,0 +1,26 @@ + +# Tender Bank Account Details + +Represents the details of a tender with `type` `BANK_ACCOUNT`. + +See [BankAccountPaymentDetails](../../doc/models/bank-account-payment-details.md) +for more exposed details of a bank account payment. + +## Structure + +`TenderBankAccountDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `status` | [`string \| undefined`](../../doc/models/tender-bank-account-details-status.md) | Optional | Indicates the bank account payment's current status. | + +## Example (as JSON) + +```json +{ + "status": "FAILED" +} +``` + diff --git a/legacy/doc/models/tender-buy-now-pay-later-details-brand.md b/legacy/doc/models/tender-buy-now-pay-later-details-brand.md new file mode 100644 index 000000000..49e6ff579 --- /dev/null +++ b/legacy/doc/models/tender-buy-now-pay-later-details-brand.md @@ -0,0 +1,14 @@ + +# Tender Buy Now Pay Later Details Brand + +## Enumeration + +`TenderBuyNowPayLaterDetailsBrand` + +## Fields + +| Name | +| --- | +| `OTHER_BRAND` | +| `AFTERPAY` | + diff --git a/legacy/doc/models/tender-buy-now-pay-later-details-status.md b/legacy/doc/models/tender-buy-now-pay-later-details-status.md new file mode 100644 index 000000000..2dacca320 --- /dev/null +++ b/legacy/doc/models/tender-buy-now-pay-later-details-status.md @@ -0,0 +1,16 @@ + +# Tender Buy Now Pay Later Details Status + +## Enumeration + +`TenderBuyNowPayLaterDetailsStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `AUTHORIZED` | The buy now pay later payment has been authorized but not yet captured. | +| `CAPTURED` | The buy now pay later payment was authorized and subsequently captured (i.e., completed). | +| `VOIDED` | The buy now pay later payment was authorized and subsequently voided (i.e., canceled). | +| `FAILED` | The buy now pay later payment failed. | + diff --git a/legacy/doc/models/tender-buy-now-pay-later-details.md b/legacy/doc/models/tender-buy-now-pay-later-details.md new file mode 100644 index 000000000..32e75a055 --- /dev/null +++ b/legacy/doc/models/tender-buy-now-pay-later-details.md @@ -0,0 +1,25 @@ + +# Tender Buy Now Pay Later Details + +Represents the details of a tender with `type` `BUY_NOW_PAY_LATER`. + +## Structure + +`TenderBuyNowPayLaterDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `buyNowPayLaterBrand` | [`string \| undefined`](../../doc/models/tender-buy-now-pay-later-details-brand.md) | Optional | - | +| `status` | [`string \| undefined`](../../doc/models/tender-buy-now-pay-later-details-status.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "buy_now_pay_later_brand": "OTHER_BRAND", + "status": "AUTHORIZED" +} +``` + diff --git a/legacy/doc/models/tender-card-details-entry-method.md b/legacy/doc/models/tender-card-details-entry-method.md new file mode 100644 index 000000000..24603553b --- /dev/null +++ b/legacy/doc/models/tender-card-details-entry-method.md @@ -0,0 +1,19 @@ + +# Tender Card Details Entry Method + +Indicates the method used to enter the card's details. + +## Enumeration + +`TenderCardDetailsEntryMethod` + +## Fields + +| Name | Description | +| --- | --- | +| `SWIPED` | The card was swiped through a Square reader or Square stand. | +| `KEYED` | The card information was keyed manually into Square Point of Sale or a
Square-hosted web form. | +| `EMV` | The card was processed via EMV with a Square reader. | +| `ON_FILE` | The buyer's card details were already on file with Square. | +| `CONTACTLESS` | The card was processed via a contactless (i.e., NFC) transaction
with a Square reader. | + diff --git a/legacy/doc/models/tender-card-details-status.md b/legacy/doc/models/tender-card-details-status.md new file mode 100644 index 000000000..fe05323ab --- /dev/null +++ b/legacy/doc/models/tender-card-details-status.md @@ -0,0 +1,18 @@ + +# Tender Card Details Status + +Indicates the card transaction's current status. + +## Enumeration + +`TenderCardDetailsStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `AUTHORIZED` | The card transaction has been authorized but not yet captured. | +| `CAPTURED` | The card transaction was authorized and subsequently captured (i.e., completed). | +| `VOIDED` | The card transaction was authorized and subsequently voided (i.e., canceled). | +| `FAILED` | The card transaction failed. | + diff --git a/legacy/doc/models/tender-card-details.md b/legacy/doc/models/tender-card-details.md new file mode 100644 index 000000000..93db96737 --- /dev/null +++ b/legacy/doc/models/tender-card-details.md @@ -0,0 +1,33 @@ + +# Tender Card Details + +Represents additional details of a tender with `type` `CARD` or `SQUARE_GIFT_CARD` + +## Structure + +`TenderCardDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `status` | [`string \| undefined`](../../doc/models/tender-card-details-status.md) | Optional | Indicates the card transaction's current status. | +| `card` | [`Card \| undefined`](../../doc/models/card.md) | Optional | 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. | +| `entryMethod` | [`string \| undefined`](../../doc/models/tender-card-details-entry-method.md) | Optional | Indicates the method used to enter the card's details. | + +## Example (as JSON) + +```json +{ + "status": "VOIDED", + "card": { + "id": "id6", + "card_brand": "OTHER_BRAND", + "last_4": "last_48", + "exp_month": 228, + "exp_year": 68 + }, + "entry_method": "CONTACTLESS" +} +``` + diff --git a/legacy/doc/models/tender-cash-details.md b/legacy/doc/models/tender-cash-details.md new file mode 100644 index 000000000..5c1b1d248 --- /dev/null +++ b/legacy/doc/models/tender-cash-details.md @@ -0,0 +1,31 @@ + +# Tender Cash Details + +Represents the details of a tender with `type` `CASH`. + +## Structure + +`TenderCashDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `buyerTenderedMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `changeBackMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "buyer_tendered_money": { + "amount": 238, + "currency": "XOF" + }, + "change_back_money": { + "amount": 78, + "currency": "XBD" + } +} +``` + diff --git a/legacy/doc/models/tender-square-account-details-status.md b/legacy/doc/models/tender-square-account-details-status.md new file mode 100644 index 000000000..8c46abdf2 --- /dev/null +++ b/legacy/doc/models/tender-square-account-details-status.md @@ -0,0 +1,16 @@ + +# Tender Square Account Details Status + +## Enumeration + +`TenderSquareAccountDetailsStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `AUTHORIZED` | The Square Account payment has been authorized but not yet captured. | +| `CAPTURED` | The Square Account payment was authorized and subsequently captured (i.e., completed). | +| `VOIDED` | The Square Account payment was authorized and subsequently voided (i.e., canceled). | +| `FAILED` | The Square Account payment failed. | + diff --git a/legacy/doc/models/tender-square-account-details.md b/legacy/doc/models/tender-square-account-details.md new file mode 100644 index 000000000..7b2da076e --- /dev/null +++ b/legacy/doc/models/tender-square-account-details.md @@ -0,0 +1,23 @@ + +# Tender Square Account Details + +Represents the details of a tender with `type` `SQUARE_ACCOUNT`. + +## Structure + +`TenderSquareAccountDetails` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `status` | [`string \| undefined`](../../doc/models/tender-square-account-details-status.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "status": "AUTHORIZED" +} +``` + diff --git a/legacy/doc/models/tender-type.md b/legacy/doc/models/tender-type.md new file mode 100644 index 000000000..6771990f6 --- /dev/null +++ b/legacy/doc/models/tender-type.md @@ -0,0 +1,24 @@ + +# Tender Type + +Indicates a tender's type. + +## Enumeration + +`TenderType` + +## Fields + +| Name | Description | +| --- | --- | +| `CARD` | A credit card. | +| `CASH` | Cash. | +| `THIRD_PARTY_CARD` | A credit card processed with a card processor other than Square.

This value applies only to merchants in countries where Square does not
yet provide card processing. | +| `SQUARE_GIFT_CARD` | A Square gift card. | +| `NO_SALE` | This tender represents the register being opened for a "no sale" event. | +| `BANK_ACCOUNT` | A bank account payment. | +| `WALLET` | A payment from a digital wallet, e.g. Cash App, Paypay, Rakuten Pay,
Au Pay, D Barai, Merpay, Wechat Pay, Alipay.

Note: Some "digital wallets", including Google Pay and Apple Pay, facilitate
card payments. Those payments have the `CARD` type. | +| `BUY_NOW_PAY_LATER` | A Buy Now Pay Later payment. | +| `SQUARE_ACCOUNT` | A Square House Account payment. | +| `OTHER` | A form of tender that does not match any other value. | + diff --git a/legacy/doc/models/tender.md b/legacy/doc/models/tender.md new file mode 100644 index 000000000..5f5b03d4f --- /dev/null +++ b/legacy/doc/models/tender.md @@ -0,0 +1,44 @@ + +# Tender + +Represents a tender (i.e., a method of payment) used in a Square transaction. + +## Structure + +`Tender` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | The tender's unique ID. It is the associated payment ID.
**Constraints**: *Maximum Length*: `192` | +| `locationId` | `string \| null \| undefined` | Optional | The ID of the transaction's associated location.
**Constraints**: *Maximum Length*: `50` | +| `transactionId` | `string \| null \| undefined` | Optional | The ID of the tender's associated transaction.
**Constraints**: *Maximum Length*: `192` | +| `createdAt` | `string \| undefined` | Optional | The timestamp for when the tender was created, in RFC 3339 format.
**Constraints**: *Maximum Length*: `32` | +| `note` | `string \| null \| undefined` | Optional | An optional note associated with the tender at the time of payment.
**Constraints**: *Maximum Length*: `500` | +| `amountMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `tipMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `processingFeeMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `customerId` | `string \| null \| undefined` | Optional | If the tender is associated with a customer or represents a customer's card on file,
this is the ID of the associated customer.
**Constraints**: *Maximum Length*: `191` | +| `type` | [`string`](../../doc/models/tender-type.md) | Required | Indicates a tender's type. | +| `cardDetails` | [`TenderCardDetails \| undefined`](../../doc/models/tender-card-details.md) | Optional | Represents additional details of a tender with `type` `CARD` or `SQUARE_GIFT_CARD` | +| `cashDetails` | [`TenderCashDetails \| undefined`](../../doc/models/tender-cash-details.md) | Optional | Represents the details of a tender with `type` `CASH`. | +| `bankAccountDetails` | [`TenderBankAccountDetails \| undefined`](../../doc/models/tender-bank-account-details.md) | Optional | Represents the details of a tender with `type` `BANK_ACCOUNT`.

See [BankAccountPaymentDetails](../../doc/models/bank-account-payment-details.md)
for more exposed details of a bank account payment. | +| `buyNowPayLaterDetails` | [`TenderBuyNowPayLaterDetails \| undefined`](../../doc/models/tender-buy-now-pay-later-details.md) | Optional | Represents the details of a tender with `type` `BUY_NOW_PAY_LATER`. | +| `squareAccountDetails` | [`TenderSquareAccountDetails \| undefined`](../../doc/models/tender-square-account-details.md) | Optional | Represents the details of a tender with `type` `SQUARE_ACCOUNT`. | +| `additionalRecipients` | [`AdditionalRecipient[] \| null \| undefined`](../../doc/models/additional-recipient.md) | Optional | Additional recipients (other than the merchant) receiving a portion of this tender.
For example, fees assessed on the purchase by a third party integration. | +| `paymentId` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `192` | + +## Example (as JSON) + +```json +{ + "id": "id8", + "location_id": "location_id2", + "transaction_id": "transaction_id6", + "created_at": "created_at6", + "note": "note4", + "type": "SQUARE_ACCOUNT" +} +``` + diff --git a/legacy/doc/models/terminal-action-action-type.md b/legacy/doc/models/terminal-action-action-type.md new file mode 100644 index 000000000..09d26ffd1 --- /dev/null +++ b/legacy/doc/models/terminal-action-action-type.md @@ -0,0 +1,22 @@ + +# Terminal Action Action Type + +Describes the type of this unit and indicates which field contains the unit information. This is an ‘open’ enum. + +## Enumeration + +`TerminalActionActionType` + +## Fields + +| Name | Description | +| --- | --- | +| `QR_CODE` | The action represents a request to display a QR code. Details are contained in
the `qr_code_options` object. | +| `PING` | The action represents a request to check if the specific device is
online or currently active with the merchant in question. Does not require an action options value. | +| `SAVE_CARD` | Represents a request to save a card for future card-on-file use. Details are contained
in the `save_card_options` object. | +| `SIGNATURE` | The action represents a request to capture a buyer's signature. Details are contained
in the `signature_options` object. | +| `CONFIRMATION` | The action represents a request to collect a buyer's confirmation decision to the
displayed terms. Details are contained in the `confirmation_options` object. | +| `RECEIPT` | The action represents a request to display the receipt screen options. Details are
contained in the `receipt_options` object. | +| `DATA_COLLECTION` | The action represents a request to collect a buyer's text data. Details
are contained in the `data_collection_options` object. | +| `SELECT` | The action represents a request to allow the buyer to select from provided options.
Details are contained in the `select_options` object. | + diff --git a/legacy/doc/models/terminal-action-query-filter.md b/legacy/doc/models/terminal-action-query-filter.md new file mode 100644 index 000000000..f6108f264 --- /dev/null +++ b/legacy/doc/models/terminal-action-query-filter.md @@ -0,0 +1,30 @@ + +# Terminal Action Query Filter + +## Structure + +`TerminalActionQueryFilter` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `deviceId` | `string \| null \| undefined` | Optional | `TerminalAction`s associated with a specific device. If no device is specified then all
`TerminalAction`s for the merchant will be displayed. | +| `createdAt` | [`TimeRange \| undefined`](../../doc/models/time-range.md) | Optional | 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. | +| `status` | `string \| null \| undefined` | Optional | Filter results with the desired status of the `TerminalAction`
Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, `COMPLETED` | +| `type` | [`string \| undefined`](../../doc/models/terminal-action-action-type.md) | Optional | Describes the type of this unit and indicates which field contains the unit information. This is an ‘open’ enum. | + +## Example (as JSON) + +```json +{ + "device_id": "device_id4", + "created_at": { + "start_at": "start_at4", + "end_at": "end_at8" + }, + "status": "status0", + "type": "DATA_COLLECTION" +} +``` + diff --git a/legacy/doc/models/terminal-action-query-sort.md b/legacy/doc/models/terminal-action-query-sort.md new file mode 100644 index 000000000..faf4326f8 --- /dev/null +++ b/legacy/doc/models/terminal-action-query-sort.md @@ -0,0 +1,21 @@ + +# Terminal Action Query Sort + +## Structure + +`TerminalActionQuerySort` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `sortOrder` | [`string \| undefined`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | + +## Example (as JSON) + +```json +{ + "sort_order": "DESC" +} +``` + diff --git a/legacy/doc/models/terminal-action-query.md b/legacy/doc/models/terminal-action-query.md new file mode 100644 index 000000000..e4ef1bf1e --- /dev/null +++ b/legacy/doc/models/terminal-action-query.md @@ -0,0 +1,42 @@ + +# Terminal Action Query + +## Structure + +`TerminalActionQuery` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `filter` | [`TerminalActionQueryFilter \| undefined`](../../doc/models/terminal-action-query-filter.md) | Optional | - | +| `sort` | [`TerminalActionQuerySort \| undefined`](../../doc/models/terminal-action-query-sort.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "include": [ + "CUSTOMER" + ], + "limit": 2, + "query": { + "filter": { + "status": "COMPLETED" + } + }, + "filter": { + "device_id": "device_id0", + "created_at": { + "start_at": "start_at4", + "end_at": "end_at8" + }, + "status": "status6", + "type": "SAVE_CARD" + }, + "sort": { + "sort_order": "DESC" + } +} +``` + diff --git a/legacy/doc/models/terminal-action.md b/legacy/doc/models/terminal-action.md new file mode 100644 index 000000000..7a6e28118 --- /dev/null +++ b/legacy/doc/models/terminal-action.md @@ -0,0 +1,46 @@ + +# Terminal Action + +Represents an action processed by the Square Terminal. + +## Structure + +`TerminalAction` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | A unique ID for this `TerminalAction`.
**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `255` | +| `deviceId` | `string \| null \| undefined` | Optional | The unique Id of the device intended for this `TerminalAction`.
The Id can be retrieved from /v2/devices api. | +| `deadlineDuration` | `string \| null \| undefined` | Optional | 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` | `string \| undefined` | Optional | The status of the `TerminalAction`.
Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, `COMPLETED` | +| `cancelReason` | [`string \| undefined`](../../doc/models/action-cancel-reason.md) | Optional | - | +| `createdAt` | `string \| undefined` | Optional | The time when the `TerminalAction` was created as an RFC 3339 timestamp. | +| `updatedAt` | `string \| undefined` | Optional | The time when the `TerminalAction` was last updated as an RFC 3339 timestamp. | +| `appId` | `string \| undefined` | Optional | The ID of the application that created the action. | +| `locationId` | `string \| undefined` | Optional | The location id the action is attached to, if a link can be made.
**Constraints**: *Maximum Length*: `64` | +| `type` | [`string \| undefined`](../../doc/models/terminal-action-action-type.md) | Optional | Describes the type of this unit and indicates which field contains the unit information. This is an ‘open’ enum. | +| `qrCodeOptions` | [`QrCodeOptions \| undefined`](../../doc/models/qr-code-options.md) | Optional | Fields to describe the action that displays QR-Codes. | +| `saveCardOptions` | [`SaveCardOptions \| undefined`](../../doc/models/save-card-options.md) | Optional | Describes save-card action fields. | +| `signatureOptions` | [`SignatureOptions \| undefined`](../../doc/models/signature-options.md) | Optional | - | +| `confirmationOptions` | [`ConfirmationOptions \| undefined`](../../doc/models/confirmation-options.md) | Optional | - | +| `receiptOptions` | [`ReceiptOptions \| undefined`](../../doc/models/receipt-options.md) | Optional | Describes receipt action fields. | +| `dataCollectionOptions` | [`DataCollectionOptions \| undefined`](../../doc/models/data-collection-options.md) | Optional | - | +| `selectOptions` | [`SelectOptions \| undefined`](../../doc/models/select-options.md) | Optional | - | +| `deviceMetadata` | [`DeviceMetadata \| undefined`](../../doc/models/device-metadata.md) | Optional | - | +| `awaitNextAction` | `boolean \| null \| undefined` | Optional | 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. | +| `awaitNextActionDuration` | `string \| null \| undefined` | Optional | 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 | + +## Example (as JSON) + +```json +{ + "id": "id8", + "device_id": "device_id4", + "deadline_duration": "deadline_duration0", + "status": "status0", + "cancel_reason": "TIMED_OUT" +} +``` + diff --git a/legacy/doc/models/terminal-checkout-query-filter.md b/legacy/doc/models/terminal-checkout-query-filter.md new file mode 100644 index 000000000..7fbdabcac --- /dev/null +++ b/legacy/doc/models/terminal-checkout-query-filter.md @@ -0,0 +1,28 @@ + +# Terminal Checkout Query Filter + +## Structure + +`TerminalCheckoutQueryFilter` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `deviceId` | `string \| null \| undefined` | Optional | The `TerminalCheckout` objects associated with a specific device. If no device is specified, then all
`TerminalCheckout` objects for the merchant are displayed. | +| `createdAt` | [`TimeRange \| undefined`](../../doc/models/time-range.md) | Optional | 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. | +| `status` | `string \| null \| undefined` | Optional | Filtered results with the desired status of the `TerminalCheckout`.
Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, `COMPLETED` | + +## Example (as JSON) + +```json +{ + "device_id": "device_id4", + "created_at": { + "start_at": "start_at4", + "end_at": "end_at8" + }, + "status": "status0" +} +``` + diff --git a/legacy/doc/models/terminal-checkout-query-sort.md b/legacy/doc/models/terminal-checkout-query-sort.md new file mode 100644 index 000000000..44d0be828 --- /dev/null +++ b/legacy/doc/models/terminal-checkout-query-sort.md @@ -0,0 +1,21 @@ + +# Terminal Checkout Query Sort + +## Structure + +`TerminalCheckoutQuerySort` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `sortOrder` | [`string \| undefined`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | + +## Example (as JSON) + +```json +{ + "sort_order": "DESC" +} +``` + diff --git a/legacy/doc/models/terminal-checkout-query.md b/legacy/doc/models/terminal-checkout-query.md new file mode 100644 index 000000000..1926229aa --- /dev/null +++ b/legacy/doc/models/terminal-checkout-query.md @@ -0,0 +1,32 @@ + +# Terminal Checkout Query + +## Structure + +`TerminalCheckoutQuery` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `filter` | [`TerminalCheckoutQueryFilter \| undefined`](../../doc/models/terminal-checkout-query-filter.md) | Optional | - | +| `sort` | [`TerminalCheckoutQuerySort \| undefined`](../../doc/models/terminal-checkout-query-sort.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "filter": { + "device_id": "device_id0", + "created_at": { + "start_at": "start_at4", + "end_at": "end_at8" + }, + "status": "status6" + }, + "sort": { + "sort_order": "DESC" + } +} +``` + diff --git a/legacy/doc/models/terminal-checkout.md b/legacy/doc/models/terminal-checkout.md new file mode 100644 index 000000000..66a7bafd8 --- /dev/null +++ b/legacy/doc/models/terminal-checkout.md @@ -0,0 +1,71 @@ + +# Terminal Checkout + +Represents a checkout processed by the Square Terminal. + +## Structure + +`TerminalCheckout` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | A unique ID for this `TerminalCheckout`.
**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `255` | +| `amountMoney` | [`Money`](../../doc/models/money.md) | Required | 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. | +| `referenceId` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `40` | +| `note` | `string \| null \| undefined` | Optional | An optional note to associate with the checkout, as well as with any payments used to complete the checkout.
Note: maximum 500 characters
**Constraints**: *Maximum Length*: `500` | +| `orderId` | `string \| null \| undefined` | Optional | The reference to the Square order ID for the checkout request. Supported only in the US. | +| `paymentOptions` | [`PaymentOptions \| undefined`](../../doc/models/payment-options.md) | Optional | - | +| `deviceOptions` | [`DeviceCheckoutOptions`](../../doc/models/device-checkout-options.md) | Required | - | +| `deadlineDuration` | `string \| null \| undefined` | Optional | 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` | `string \| undefined` | Optional | The status of the `TerminalCheckout`.
Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, `COMPLETED` | +| `cancelReason` | [`string \| undefined`](../../doc/models/action-cancel-reason.md) | Optional | - | +| `paymentIds` | `string[] \| undefined` | Optional | A list of IDs for payments created by this `TerminalCheckout`. | +| `createdAt` | `string \| undefined` | Optional | The time when the `TerminalCheckout` was created, as an RFC 3339 timestamp. | +| `updatedAt` | `string \| undefined` | Optional | The time when the `TerminalCheckout` was last updated, as an RFC 3339 timestamp. | +| `appId` | `string \| undefined` | Optional | The ID of the application that created the checkout. | +| `locationId` | `string \| undefined` | Optional | The location of the device where the `TerminalCheckout` was directed.
**Constraints**: *Maximum Length*: `64` | +| `paymentType` | [`string \| undefined`](../../doc/models/checkout-options-payment-type.md) | Optional | - | +| `teamMemberId` | `string \| null \| undefined` | Optional | An optional ID of the team member associated with creating the checkout. | +| `customerId` | `string \| null \| undefined` | Optional | An optional ID of the customer associated with the checkout. | +| `appFeeMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | +| `statementDescriptionIdentifier` | `string \| null \| undefined` | Optional | 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. Supported only in the US.
**Constraints**: *Maximum Length*: `20` | +| `tipMoney` | [`Money \| undefined`](../../doc/models/money.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "id": "id6", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "reference_id": "reference_id6", + "note": "note8", + "order_id": "order_id0", + "payment_options": { + "autocomplete": false, + "delay_duration": "delay_duration2", + "accept_partial_authorization": false, + "delay_action": "CANCEL" + }, + "device_options": { + "device_id": "device_id6", + "skip_receipt_screen": false, + "collect_signature": false, + "tip_settings": { + "allow_tipping": false, + "separate_tip_screen": false, + "custom_tip_field": false, + "tip_percentages": [ + 48 + ], + "smart_tipping": false + }, + "show_itemized_cart": false + } +} +``` + diff --git a/legacy/doc/models/terminal-refund-query-filter.md b/legacy/doc/models/terminal-refund-query-filter.md new file mode 100644 index 000000000..990a01c21 --- /dev/null +++ b/legacy/doc/models/terminal-refund-query-filter.md @@ -0,0 +1,28 @@ + +# Terminal Refund Query Filter + +## Structure + +`TerminalRefundQueryFilter` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `deviceId` | `string \| null \| undefined` | Optional | `TerminalRefund` objects associated with a specific device. If no device is specified, then all
`TerminalRefund` objects for the signed-in account are displayed. | +| `createdAt` | [`TimeRange \| undefined`](../../doc/models/time-range.md) | Optional | 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. | +| `status` | `string \| null \| undefined` | Optional | Filtered results with the desired status of the `TerminalRefund`.
Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, or `COMPLETED`. | + +## Example (as JSON) + +```json +{ + "device_id": "device_id4", + "created_at": { + "start_at": "start_at4", + "end_at": "end_at8" + }, + "status": "status0" +} +``` + diff --git a/legacy/doc/models/terminal-refund-query-sort.md b/legacy/doc/models/terminal-refund-query-sort.md new file mode 100644 index 000000000..9c596f957 --- /dev/null +++ b/legacy/doc/models/terminal-refund-query-sort.md @@ -0,0 +1,21 @@ + +# Terminal Refund Query Sort + +## Structure + +`TerminalRefundQuerySort` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `sortOrder` | `string \| null \| undefined` | Optional | The order in which results are listed.

- `ASC` - Oldest to newest.
- `DESC` - Newest to oldest (default). | + +## Example (as JSON) + +```json +{ + "sort_order": "sort_order0" +} +``` + diff --git a/legacy/doc/models/terminal-refund-query.md b/legacy/doc/models/terminal-refund-query.md new file mode 100644 index 000000000..3a4e78e34 --- /dev/null +++ b/legacy/doc/models/terminal-refund-query.md @@ -0,0 +1,32 @@ + +# Terminal Refund Query + +## Structure + +`TerminalRefundQuery` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `filter` | [`TerminalRefundQueryFilter \| undefined`](../../doc/models/terminal-refund-query-filter.md) | Optional | - | +| `sort` | [`TerminalRefundQuerySort \| undefined`](../../doc/models/terminal-refund-query-sort.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "filter": { + "device_id": "device_id0", + "created_at": { + "start_at": "start_at4", + "end_at": "end_at8" + }, + "status": "status6" + }, + "sort": { + "sort_order": "sort_order8" + } +} +``` + diff --git a/legacy/doc/models/terminal-refund.md b/legacy/doc/models/terminal-refund.md new file mode 100644 index 000000000..db2be085f --- /dev/null +++ b/legacy/doc/models/terminal-refund.md @@ -0,0 +1,47 @@ + +# Terminal Refund + +Represents a payment refund processed by the Square Terminal. Only supports Interac (Canadian debit network) payment refunds. + +## Structure + +`TerminalRefund` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | A unique ID for this `TerminalRefund`.
**Constraints**: *Minimum Length*: `10`, *Maximum Length*: `255` | +| `refundId` | `string \| undefined` | Optional | The reference to the payment refund created by completing this `TerminalRefund`. | +| `paymentId` | `string` | Required | The unique ID of the payment being refunded.
**Constraints**: *Minimum Length*: `1` | +| `orderId` | `string \| undefined` | Optional | The reference to the Square order ID for the payment identified by the `payment_id`. | +| `amountMoney` | [`Money`](../../doc/models/money.md) | Required | 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. | +| `reason` | `string` | Required | A description of the reason for the refund.
**Constraints**: *Maximum Length*: `192` | +| `deviceId` | `string` | Required | The unique ID of the device intended for this `TerminalRefund`.
The Id can be retrieved from /v2/devices api. | +| `deadlineDuration` | `string \| null \| undefined` | Optional | 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` | `string \| undefined` | Optional | The status of the `TerminalRefund`.
Options: `PENDING`, `IN_PROGRESS`, `CANCEL_REQUESTED`, `CANCELED`, or `COMPLETED`. | +| `cancelReason` | [`string \| undefined`](../../doc/models/action-cancel-reason.md) | Optional | - | +| `createdAt` | `string \| undefined` | Optional | The time when the `TerminalRefund` was created, as an RFC 3339 timestamp. | +| `updatedAt` | `string \| undefined` | Optional | The time when the `TerminalRefund` was last updated, as an RFC 3339 timestamp. | +| `appId` | `string \| undefined` | Optional | The ID of the application that created the refund. | +| `locationId` | `string \| undefined` | Optional | The location of the device where the `TerminalRefund` was directed.
**Constraints**: *Maximum Length*: `64` | + +## Example (as JSON) + +```json +{ + "id": "id8", + "refund_id": "refund_id2", + "payment_id": "payment_id8", + "order_id": "order_id2", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "reason": "reason6", + "device_id": "device_id4", + "deadline_duration": "deadline_duration0", + "status": "status0" +} +``` + diff --git a/legacy/doc/models/test-webhook-subscription-request.md b/legacy/doc/models/test-webhook-subscription-request.md new file mode 100644 index 000000000..405461362 --- /dev/null +++ b/legacy/doc/models/test-webhook-subscription-request.md @@ -0,0 +1,23 @@ + +# Test Webhook Subscription Request + +Tests a [Subscription](../../doc/models/webhook-subscription.md) by sending a test event to its notification URL. + +## Structure + +`TestWebhookSubscriptionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `eventType` | `string \| null \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "event_type": "payment.created" +} +``` + diff --git a/legacy/doc/models/test-webhook-subscription-response.md b/legacy/doc/models/test-webhook-subscription-response.md new file mode 100644 index 000000000..1ce9b46f6 --- /dev/null +++ b/legacy/doc/models/test-webhook-subscription-response.md @@ -0,0 +1,48 @@ + +# Test Webhook Subscription Response + +Defines the fields that are included in the response body of +a request to the [TestWebhookSubscription](../../doc/api/webhook-subscriptions.md#test-webhook-subscription) endpoint. + +Note: If there are errors processing the request, the [SubscriptionTestResult](../../doc/models/subscription-test-result.md) field is not +present. + +## Structure + +`TestWebhookSubscriptionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | +| `subscriptionTestResult` | [`SubscriptionTestResult \| undefined`](../../doc/models/subscription-test-result.md) | Optional | Represents the details of a webhook subscription, including notification URL,
event types, and signature key. | + +## Example (as JSON) + +```json +{ + "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" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/time-range.md b/legacy/doc/models/time-range.md new file mode 100644 index 000000000..8e1775f14 --- /dev/null +++ b/legacy/doc/models/time-range.md @@ -0,0 +1,29 @@ + +# Time Range + +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. + +## Structure + +`TimeRange` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `startAt` | `string \| null \| undefined` | Optional | A datetime value in RFC 3339 format indicating when the time range
starts. | +| `endAt` | `string \| null \| undefined` | Optional | A datetime value in RFC 3339 format indicating when the time range
ends. | + +## Example (as JSON) + +```json +{ + "start_at": "start_at2", + "end_at": "end_at0" +} +``` + diff --git a/legacy/doc/models/tip-settings.md b/legacy/doc/models/tip-settings.md new file mode 100644 index 000000000..627446bc3 --- /dev/null +++ b/legacy/doc/models/tip-settings.md @@ -0,0 +1,33 @@ + +# Tip Settings + +## Structure + +`TipSettings` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `allowTipping` | `boolean \| null \| undefined` | Optional | Indicates whether tipping is enabled for this checkout. Defaults to false. | +| `separateTipScreen` | `boolean \| null \| undefined` | Optional | Indicates whether tip options should be presented on the screen before presenting
the signature screen during card payment. Defaults to false. | +| `customTipField` | `boolean \| null \| undefined` | Optional | Indicates whether custom tip amounts are allowed during the checkout flow. Defaults to false. | +| `tipPercentages` | `number[] \| null \| undefined` | Optional | 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. | +| `smartTipping` | `boolean \| null \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "allow_tipping": false, + "separate_tip_screen": false, + "custom_tip_field": false, + "tip_percentages": [ + 66, + 67, + 68 + ], + "smart_tipping": false +} +``` + diff --git a/legacy/doc/models/transaction-product.md b/legacy/doc/models/transaction-product.md new file mode 100644 index 000000000..d6237d9c6 --- /dev/null +++ b/legacy/doc/models/transaction-product.md @@ -0,0 +1,22 @@ + +# Transaction Product + +Indicates the Square product used to process a transaction. + +## Enumeration + +`TransactionProduct` + +## Fields + +| Name | Description | +| --- | --- | +| `REGISTER` | Square Point of Sale. | +| `EXTERNAL_API` | The Square Connect API. | +| `BILLING` | A Square subscription for one of multiple products. | +| `APPOINTMENTS` | Square Appointments. | +| `INVOICES` | Square Invoices. | +| `ONLINE_STORE` | Square Online Store. | +| `PAYROLL` | Square Payroll. | +| `OTHER` | A Square product that does not match any other value. | + diff --git a/legacy/doc/models/transaction-type.md b/legacy/doc/models/transaction-type.md new file mode 100644 index 000000000..fdc3351a4 --- /dev/null +++ b/legacy/doc/models/transaction-type.md @@ -0,0 +1,16 @@ + +# Transaction Type + +The transaction type used in the disputed payment. + +## Enumeration + +`TransactionType` + +## Fields + +| Name | +| --- | +| `DEBIT` | +| `CREDIT` | + diff --git a/legacy/doc/models/transaction.md b/legacy/doc/models/transaction.md new file mode 100644 index 000000000..59900cd37 --- /dev/null +++ b/legacy/doc/models/transaction.md @@ -0,0 +1,177 @@ + +# Transaction + +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. + +## Structure + +`Transaction` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | The transaction's unique ID, issued by Square payments servers.
**Constraints**: *Maximum Length*: `192` | +| `locationId` | `string \| null \| undefined` | Optional | The ID of the transaction's associated location.
**Constraints**: *Maximum Length*: `50` | +| `createdAt` | `string \| undefined` | Optional | The timestamp for when the transaction was created, in RFC 3339 format.
**Constraints**: *Maximum Length*: `32` | +| `tenders` | [`Tender[] \| null \| undefined`](../../doc/models/tender.md) | Optional | The tenders used to pay in the transaction. | +| `refunds` | [`Refund[] \| null \| undefined`](../../doc/models/refund.md) | Optional | Refunds that have been applied to any tender in the transaction. | +| `referenceId` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `40` | +| `product` | [`string \| undefined`](../../doc/models/transaction-product.md) | Optional | Indicates the Square product used to process a transaction. | +| `clientId` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `192` | +| `shippingAddress` | [`Address \| undefined`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | +| `orderId` | `string \| null \| undefined` | Optional | The order_id is an identifier for the order associated with this transaction, if any.
**Constraints**: *Maximum Length*: `192` | + +## Example (as JSON) + +```json +{ + "id": "id4", + "location_id": "location_id8", + "created_at": "created_at8", + "tenders": [ + { + "id": "id8", + "location_id": "location_id2", + "transaction_id": "transaction_id6", + "created_at": "created_at6", + "note": "note4", + "type": "THIRD_PARTY_CARD" + }, + { + "id": "id8", + "location_id": "location_id2", + "transaction_id": "transaction_id6", + "created_at": "created_at6", + "note": "note4", + "type": "THIRD_PARTY_CARD" + }, + { + "id": "id8", + "location_id": "location_id2", + "transaction_id": "transaction_id6", + "created_at": "created_at6", + "note": "note4", + "type": "THIRD_PARTY_CARD" + } + ], + "refunds": [ + { + "id": "id8", + "location_id": "location_id2", + "transaction_id": "transaction_id6", + "tender_id": "tender_id6", + "created_at": "created_at6", + "reason": "reason4", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "status": "PENDING", + "processing_fee_money": { + "amount": 112, + "currency": "DJF" + }, + "additional_recipients": [ + { + "location_id": "location_id0", + "description": "description6", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "receivable_id": "receivable_id6" + }, + { + "location_id": "location_id0", + "description": "description6", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "receivable_id": "receivable_id6" + } + ] + }, + { + "id": "id8", + "location_id": "location_id2", + "transaction_id": "transaction_id6", + "tender_id": "tender_id6", + "created_at": "created_at6", + "reason": "reason4", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "status": "PENDING", + "processing_fee_money": { + "amount": 112, + "currency": "DJF" + }, + "additional_recipients": [ + { + "location_id": "location_id0", + "description": "description6", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "receivable_id": "receivable_id6" + }, + { + "location_id": "location_id0", + "description": "description6", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "receivable_id": "receivable_id6" + } + ] + }, + { + "id": "id8", + "location_id": "location_id2", + "transaction_id": "transaction_id6", + "tender_id": "tender_id6", + "created_at": "created_at6", + "reason": "reason4", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "status": "PENDING", + "processing_fee_money": { + "amount": 112, + "currency": "DJF" + }, + "additional_recipients": [ + { + "location_id": "location_id0", + "description": "description6", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "receivable_id": "receivable_id6" + }, + { + "location_id": "location_id0", + "description": "description6", + "amount_money": { + "amount": 186, + "currency": "AUD" + }, + "receivable_id": "receivable_id6" + } + ] + } + ] +} +``` + diff --git a/legacy/doc/models/unlink-customer-from-gift-card-request.md b/legacy/doc/models/unlink-customer-from-gift-card-request.md new file mode 100644 index 000000000..5148a9beb --- /dev/null +++ b/legacy/doc/models/unlink-customer-from-gift-card-request.md @@ -0,0 +1,23 @@ + +# Unlink Customer From Gift Card Request + +A request to unlink a customer from a gift card. + +## Structure + +`UnlinkCustomerFromGiftCardRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customerId` | `string` | Required | The ID of the customer to unlink from the gift card.
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `191` | + +## Example (as JSON) + +```json +{ + "customer_id": "GKY0FZ3V717AH8Q2D821PNT2ZW" +} +``` + diff --git a/legacy/doc/models/unlink-customer-from-gift-card-response.md b/legacy/doc/models/unlink-customer-from-gift-card-response.md new file mode 100644 index 000000000..b9225e48f --- /dev/null +++ b/legacy/doc/models/unlink-customer-from-gift-card-response.md @@ -0,0 +1,56 @@ + +# Unlink Customer From Gift Card Response + +A response that contains the unlinked `GiftCard` object. If the request resulted in errors, +the response contains a set of `Error` objects. + +## Structure + +`UnlinkCustomerFromGiftCardResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `giftCard` | [`GiftCard \| undefined`](../../doc/models/gift-card.md) | Optional | Represents a Square gift card. | + +## Example (as JSON) + +```json +{ + "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" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/update-booking-custom-attribute-definition-request.md b/legacy/doc/models/update-booking-custom-attribute-definition-request.md new file mode 100644 index 000000000..4a779aa11 --- /dev/null +++ b/legacy/doc/models/update-booking-custom-attribute-definition-request.md @@ -0,0 +1,34 @@ + +# Update Booking Custom Attribute Definition Request + +Represents an [UpdateBookingCustomAttributeDefinition](../../doc/api/booking-custom-attributes.md#update-booking-custom-attribute-definition) request. + +## Structure + +`UpdateBookingCustomAttributeDefinitionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttributeDefinition` | [`CustomAttributeDefinition`](../../doc/models/custom-attribute-definition.md) | Required | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | +| `idempotencyKey` | `string \| null \| undefined` | Optional | 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).
**Constraints**: *Maximum Length*: `45` | + +## Example (as JSON) + +```json +{ + "custom_attribute_definition": { + "key": "key2", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name2", + "description": "description8", + "visibility": "VISIBILITY_HIDDEN" + }, + "idempotency_key": "idempotency_key2" +} +``` + diff --git a/legacy/doc/models/update-booking-custom-attribute-definition-response.md b/legacy/doc/models/update-booking-custom-attribute-definition-response.md new file mode 100644 index 000000000..ffe9539db --- /dev/null +++ b/legacy/doc/models/update-booking-custom-attribute-definition-response.md @@ -0,0 +1,38 @@ + +# Update Booking Custom Attribute Definition Response + +Represents an [UpdateBookingCustomAttributeDefinition](../../doc/api/booking-custom-attributes.md#update-booking-custom-attribute-definition) response. +Either `custom_attribute_definition` or `errors` is present in the response. + +## Structure + +`UpdateBookingCustomAttributeDefinitionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttributeDefinition` | [`CustomAttributeDefinition \| undefined`](../../doc/models/custom-attribute-definition.md) | Optional | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "custom_attribute_definition": { + "created_at": "2022-11-16T15:27:30Z", + "description": "Update the description as desired.", + "key": "favoriteShampoo", + "name": "Favorite shampoo", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "updated_at": "2022-11-16T15:39:38Z", + "version": 2, + "visibility": "VISIBILITY_READ_ONLY" + }, + "errors": [] +} +``` + diff --git a/legacy/doc/models/update-booking-request.md b/legacy/doc/models/update-booking-request.md new file mode 100644 index 000000000..6f75bbb8d --- /dev/null +++ b/legacy/doc/models/update-booking-request.md @@ -0,0 +1,29 @@ + +# Update Booking Request + +## Structure + +`UpdateBookingRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string \| null \| undefined` | Optional | A unique key to make this request an idempotent operation.
**Constraints**: *Maximum Length*: `255` | +| `booking` | [`Booking`](../../doc/models/booking.md) | Required | 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. | + +## Example (as JSON) + +```json +{ + "idempotency_key": "idempotency_key4", + "booking": { + "id": "id4", + "version": 156, + "status": "CANCELLED_BY_SELLER", + "created_at": "created_at2", + "updated_at": "updated_at0" + } +} +``` + diff --git a/legacy/doc/models/update-booking-response.md b/legacy/doc/models/update-booking-response.md new file mode 100644 index 000000000..ceeed45fb --- /dev/null +++ b/legacy/doc/models/update-booking-response.md @@ -0,0 +1,50 @@ + +# Update Booking Response + +## Structure + +`UpdateBookingResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `booking` | [`Booking \| undefined`](../../doc/models/booking.md) | Optional | 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. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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": [] +} +``` + diff --git a/legacy/doc/models/update-break-type-request.md b/legacy/doc/models/update-break-type-request.md new file mode 100644 index 000000000..e2d0cb9de --- /dev/null +++ b/legacy/doc/models/update-break-type-request.md @@ -0,0 +1,32 @@ + +# Update Break Type Request + +A request to update a `BreakType`. + +## Structure + +`UpdateBreakTypeRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `breakType` | [`BreakType`](../../doc/models/break-type.md) | Required | A defined break template that sets an expectation for possible `Break`
instances on a `Shift`. | + +## Example (as JSON) + +```json +{ + "break_type": { + "break_name": "Lunch", + "expected_duration": "PT50M", + "is_paid": true, + "location_id": "26M7H24AZ9N6R", + "version": 1, + "id": "id8", + "created_at": "created_at6", + "updated_at": "updated_at4" + } +} +``` + diff --git a/legacy/doc/models/update-break-type-response.md b/legacy/doc/models/update-break-type-response.md new file mode 100644 index 000000000..e1e54fb8e --- /dev/null +++ b/legacy/doc/models/update-break-type-response.md @@ -0,0 +1,43 @@ + +# Update Break Type Response + +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. + +## Structure + +`UpdateBreakTypeResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `breakType` | [`BreakType \| undefined`](../../doc/models/break-type.md) | Optional | A defined break template that sets an expectation for possible `Break`
instances on a `Shift`. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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 + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/update-catalog-image-request.md b/legacy/doc/models/update-catalog-image-request.md new file mode 100644 index 000000000..f5085fea2 --- /dev/null +++ b/legacy/doc/models/update-catalog-image-request.md @@ -0,0 +1,29 @@ + +# Update Catalog Image Request + +## Structure + +`UpdateCatalogImageRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string` | Required | 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.
**Constraints**: *Minimum Length*: `1` | + +## Example (as JSON) + +```json +{ + "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" +} +``` + diff --git a/legacy/doc/models/update-catalog-image-response.md b/legacy/doc/models/update-catalog-image-response.md new file mode 100644 index 000000000..ea7161e1e --- /dev/null +++ b/legacy/doc/models/update-catalog-image-response.md @@ -0,0 +1,77 @@ + +# Update Catalog Image Response + +## Structure + +`UpdateCatalogImageResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `image` | [`CatalogObject \| undefined`](../../doc/models/catalog-object.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "image": { + "id": "L52QOQN2SW3M5QTF9JOCQKNB", + "image_data": { + "caption": "A picture of a cup of coffee", + "name": "Coffee", + "url": "https://..." + }, + "type": "IMAGE", + "updated_at": "updated_at2", + "version": 100, + "is_deleted": false, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/update-customer-custom-attribute-definition-request.md b/legacy/doc/models/update-customer-custom-attribute-definition-request.md new file mode 100644 index 000000000..082b412ec --- /dev/null +++ b/legacy/doc/models/update-customer-custom-attribute-definition-request.md @@ -0,0 +1,34 @@ + +# Update Customer Custom Attribute Definition Request + +Represents an [UpdateCustomerCustomAttributeDefinition](../../doc/api/customer-custom-attributes.md#update-customer-custom-attribute-definition) request. + +## Structure + +`UpdateCustomerCustomAttributeDefinitionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttributeDefinition` | [`CustomAttributeDefinition`](../../doc/models/custom-attribute-definition.md) | Required | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | +| `idempotencyKey` | `string \| null \| undefined` | Optional | 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).
**Constraints**: *Maximum Length*: `45` | + +## Example (as JSON) + +```json +{ + "custom_attribute_definition": { + "description": "Update the description as desired.", + "visibility": "VISIBILITY_READ_ONLY", + "key": "key2", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name2" + }, + "idempotency_key": "idempotency_key2" +} +``` + diff --git a/legacy/doc/models/update-customer-custom-attribute-definition-response.md b/legacy/doc/models/update-customer-custom-attribute-definition-response.md new file mode 100644 index 000000000..56b2aa200 --- /dev/null +++ b/legacy/doc/models/update-customer-custom-attribute-definition-response.md @@ -0,0 +1,57 @@ + +# Update Customer Custom Attribute Definition Response + +Represents an [UpdateCustomerCustomAttributeDefinition](../../doc/api/customer-custom-attributes.md#update-customer-custom-attribute-definition) response. +Either `custom_attribute_definition` or `errors` is present in the response. + +## Structure + +`UpdateCustomerCustomAttributeDefinitionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttributeDefinition` | [`CustomAttributeDefinition \| undefined`](../../doc/models/custom-attribute-definition.md) | Optional | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "custom_attribute_definition": { + "created_at": "2022-04-26T15:27:30Z", + "description": "Update the description as desired.", + "key": "favoritemovie", + "name": "Favorite Movie", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "updated_at": "2022-04-26T15:39:38Z", + "version": 2, + "visibility": "VISIBILITY_READ_ONLY" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/update-customer-group-request.md b/legacy/doc/models/update-customer-group-request.md new file mode 100644 index 000000000..16e60f99b --- /dev/null +++ b/legacy/doc/models/update-customer-group-request.md @@ -0,0 +1,29 @@ + +# Update Customer Group Request + +Defines the body parameters that can be included in a request to the +[UpdateCustomerGroup](../../doc/api/customer-groups.md#update-customer-group) endpoint. + +## Structure + +`UpdateCustomerGroupRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `group` | [`CustomerGroup`](../../doc/models/customer-group.md) | Required | 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. | + +## Example (as JSON) + +```json +{ + "group": { + "name": "Loyal Customers", + "id": "id8", + "created_at": "created_at4", + "updated_at": "updated_at6" + } +} +``` + diff --git a/legacy/doc/models/update-customer-group-response.md b/legacy/doc/models/update-customer-group-response.md new file mode 100644 index 000000000..9c0c1ddea --- /dev/null +++ b/legacy/doc/models/update-customer-group-response.md @@ -0,0 +1,52 @@ + +# Update Customer Group Response + +Defines the fields that are included in the response body of +a request to the [UpdateCustomerGroup](../../doc/api/customer-groups.md#update-customer-group) endpoint. + +Either `errors` or `group` is present in a given response (never both). + +## Structure + +`UpdateCustomerGroupResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `group` | [`CustomerGroup \| undefined`](../../doc/models/customer-group.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "group": { + "created_at": "2020-04-13T21:54:57.863Z", + "id": "2TAT3CMH4Q0A9M87XJZED0WMR3", + "name": "Loyal Customers", + "updated_at": "2020-04-13T21:54:58Z" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/update-customer-request.md b/legacy/doc/models/update-customer-request.md new file mode 100644 index 000000000..1c8ae30f3 --- /dev/null +++ b/legacy/doc/models/update-customer-request.md @@ -0,0 +1,42 @@ + +# Update Customer Request + +Defines the body parameters that can be included in a request to the +`UpdateCustomer` endpoint. + +## Structure + +`UpdateCustomerRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `givenName` | `string \| null \| undefined` | Optional | The given name (that is, the first name) associated with the customer profile.

The maximum length for this value is 300 characters. | +| `familyName` | `string \| null \| undefined` | Optional | The family name (that is, the last name) associated with the customer profile.

The maximum length for this value is 300 characters. | +| `companyName` | `string \| null \| undefined` | Optional | A business name associated with the customer profile.

The maximum length for this value is 500 characters. | +| `nickname` | `string \| null \| undefined` | Optional | A nickname for the customer profile.

The maximum length for this value is 100 characters. | +| `emailAddress` | `string \| null \| undefined` | Optional | The email address associated with the customer profile.

The maximum length for this value is 254 characters. | +| `address` | [`Address \| undefined`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | +| `phoneNumber` | `string \| null \| undefined` | Optional | 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). | +| `referenceId` | `string \| null \| undefined` | Optional | 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` | `string \| null \| undefined` | Optional | A custom note associated with the customer profile. | +| `birthday` | `string \| null \| undefined` | Optional | 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` | `bigint \| undefined` | Optional | 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). | +| `taxIds` | [`CustomerTaxIds \| undefined`](../../doc/models/customer-tax-ids.md) | Optional | Represents the tax ID associated with a [customer profile](../../doc/models/customer.md). 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). | + +## Example (as JSON) + +```json +{ + "email_address": "New.Amelia.Earhart@example.com", + "note": "updated customer note", + "phone_number": null, + "version": 2, + "given_name": "given_name0", + "family_name": "family_name8", + "company_name": "company_name4", + "nickname": "nickname4" +} +``` + diff --git a/legacy/doc/models/update-customer-response.md b/legacy/doc/models/update-customer-response.md new file mode 100644 index 000000000..1b3673395 --- /dev/null +++ b/legacy/doc/models/update-customer-response.md @@ -0,0 +1,73 @@ + +# Update Customer Response + +Defines the fields that are included in the response body of +a request to the [UpdateCustomer](../../doc/api/customers.md#update-customer) or +[BulkUpdateCustomers](../../doc/api/customers.md#bulk-update-customers) endpoint. + +Either `errors` or `customer` is present in a given response (never both). + +## Structure + +`UpdateCustomerResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `customer` | [`Customer \| undefined`](../../doc/models/customer.md) | Optional | Represents a Square customer profile in the Customer Directory of a Square seller. | + +## Example (as JSON) + +```json +{ + "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, + "cards": [ + { + "id": "id8", + "card_brand": "DISCOVER", + "last_4": "last_40", + "exp_month": 152, + "exp_year": 144 + } + ] + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/update-invoice-request.md b/legacy/doc/models/update-invoice-request.md new file mode 100644 index 000000000..65149f5a8 --- /dev/null +++ b/legacy/doc/models/update-invoice-request.md @@ -0,0 +1,56 @@ + +# Update Invoice Request + +Describes a `UpdateInvoice` request. + +## Structure + +`UpdateInvoiceRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `invoice` | [`Invoice`](../../doc/models/invoice.md) | Required | 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). | +| `idempotencyKey` | `string \| null \| undefined` | Optional | 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).
**Constraints**: *Maximum Length*: `128` | +| `fieldsToClear` | `string[] \| null \| undefined` | Optional | 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). | + +## Example (as JSON) + +```json +{ + "idempotency_key": "4ee82288-0910-499e-ab4c-5d0071dad1be", + "invoice": { + "payment_requests": [ + { + "reminders": null, + "tipping_enabled": false, + "uid": "2da7964f-f3d2-4f43-81e8-5aa220bf3355" + } + ], + "version": 1, + "id": "id6", + "location_id": "location_id0", + "order_id": "order_id0", + "primary_recipient": { + "customer_id": "customer_id2", + "given_name": "given_name6", + "family_name": "family_name8", + "email_address": "email_address2", + "address": { + "address_line_1": "address_line_16", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "locality": "locality6", + "sublocality": "sublocality6" + } + } + }, + "fields_to_clear": [ + "fields_to_clear1", + "fields_to_clear2", + "fields_to_clear3" + ] +} +``` + diff --git a/legacy/doc/models/update-invoice-response.md b/legacy/doc/models/update-invoice-response.md new file mode 100644 index 000000000..32ad0ef7e --- /dev/null +++ b/legacy/doc/models/update-invoice-response.md @@ -0,0 +1,108 @@ + +# Update Invoice Response + +Describes a `UpdateInvoice` response. + +## Structure + +`UpdateInvoiceResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `invoice` | [`Invoice \| undefined`](../../doc/models/invoice.md) | Optional | 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). | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | + +## Example (as JSON) + +```json +{ + "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", + "address": { + "address_line_1": "address_line_16", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "locality": "locality6", + "sublocality": "sublocality6" + } + }, + "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 + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/update-item-modifier-lists-request.md b/legacy/doc/models/update-item-modifier-lists-request.md new file mode 100644 index 000000000..8686442df --- /dev/null +++ b/legacy/doc/models/update-item-modifier-lists-request.md @@ -0,0 +1,33 @@ + +# Update Item Modifier Lists Request + +## Structure + +`UpdateItemModifierListsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `itemIds` | `string[]` | Required | The IDs of the catalog items associated with the CatalogModifierList objects being updated. | +| `modifierListsToEnable` | `string[] \| null \| undefined` | Optional | 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. | +| `modifierListsToDisable` | `string[] \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "item_ids": [ + "H42BRLUJ5KTZTTMPVSLFAACQ", + "2JXOBJIHCWBQ4NZ3RIXQGJA6" + ], + "modifier_lists_to_disable": [ + "7WRC16CJZDVLSNDQ35PP6YAD" + ], + "modifier_lists_to_enable": [ + "H42BRLUJ5KTZTTMPVSLFAACQ", + "2JXOBJIHCWBQ4NZ3RIXQGJA6" + ] +} +``` + diff --git a/legacy/doc/models/update-item-modifier-lists-response.md b/legacy/doc/models/update-item-modifier-lists-response.md new file mode 100644 index 000000000..fe3a22cea --- /dev/null +++ b/legacy/doc/models/update-item-modifier-lists-response.md @@ -0,0 +1,42 @@ + +# Update Item Modifier Lists Response + +## Structure + +`UpdateItemModifierListsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `updatedAt` | `string \| undefined` | Optional | 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 (as JSON) + +```json +{ + "updated_at": "2016-11-16T22:25:24.878Z", + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/update-item-taxes-request.md b/legacy/doc/models/update-item-taxes-request.md new file mode 100644 index 000000000..e9b239000 --- /dev/null +++ b/legacy/doc/models/update-item-taxes-request.md @@ -0,0 +1,32 @@ + +# Update Item Taxes Request + +## Structure + +`UpdateItemTaxesRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `itemIds` | `string[]` | Required | IDs for the CatalogItems associated with the CatalogTax objects being updated.
No more than 1,000 IDs may be provided. | +| `taxesToEnable` | `string[] \| null \| undefined` | Optional | IDs of the CatalogTax objects to enable.
At least one of `taxes_to_enable` or `taxes_to_disable` must be specified. | +| `taxesToDisable` | `string[] \| null \| undefined` | Optional | IDs of the CatalogTax objects to disable.
At least one of `taxes_to_enable` or `taxes_to_disable` must be specified. | + +## Example (as JSON) + +```json +{ + "item_ids": [ + "H42BRLUJ5KTZTTMPVSLFAACQ", + "2JXOBJIHCWBQ4NZ3RIXQGJA6" + ], + "taxes_to_disable": [ + "AQCEGCEBBQONINDOHRGZISEX" + ], + "taxes_to_enable": [ + "4WRCNHCJZDVLSNDQ35PP6YAD" + ] +} +``` + diff --git a/legacy/doc/models/update-item-taxes-response.md b/legacy/doc/models/update-item-taxes-response.md new file mode 100644 index 000000000..e0d4d268a --- /dev/null +++ b/legacy/doc/models/update-item-taxes-response.md @@ -0,0 +1,42 @@ + +# Update Item Taxes Response + +## Structure + +`UpdateItemTaxesResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `updatedAt` | `string \| undefined` | Optional | 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 (as JSON) + +```json +{ + "updated_at": "2016-11-16T22:25:24.878Z", + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/update-job-request.md b/legacy/doc/models/update-job-request.md new file mode 100644 index 000000000..997e75cf9 --- /dev/null +++ b/legacy/doc/models/update-job-request.md @@ -0,0 +1,29 @@ + +# Update Job Request + +Represents an [UpdateJob](../../doc/api/team.md#update-job) request. + +## Structure + +`UpdateJobRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `job` | [`Job`](../../doc/models/job.md) | Required | Represents a job that can be assigned to [team members](../../doc/models/team-member.md). This object defines the
job's title and tip eligibility. Compensation is defined in a [job assignment](../../doc/models/job-assignment.md)
in a team member's wage setting. | + +## Example (as JSON) + +```json +{ + "job": { + "is_tip_eligible": true, + "title": "Cashier 1", + "id": "id6", + "created_at": "created_at4", + "updated_at": "updated_at8" + } +} +``` + diff --git a/legacy/doc/models/update-job-response.md b/legacy/doc/models/update-job-response.md new file mode 100644 index 000000000..6a1b39004 --- /dev/null +++ b/legacy/doc/models/update-job-response.md @@ -0,0 +1,52 @@ + +# Update Job Response + +Represents an [UpdateJob](../../doc/api/team.md#update-job) response. Either `job` or `errors` +is present in the response. + +## Structure + +`UpdateJobResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `job` | [`Job \| undefined`](../../doc/models/job.md) | Optional | Represents a job that can be assigned to [team members](../../doc/models/team-member.md). This object defines the
job's title and tip eligibility. Compensation is defined in a [job assignment](../../doc/models/job-assignment.md)
in a team member's wage setting. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | The errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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 + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/update-location-custom-attribute-definition-request.md b/legacy/doc/models/update-location-custom-attribute-definition-request.md new file mode 100644 index 000000000..fc60f3722 --- /dev/null +++ b/legacy/doc/models/update-location-custom-attribute-definition-request.md @@ -0,0 +1,34 @@ + +# Update Location Custom Attribute Definition Request + +Represents an [UpdateLocationCustomAttributeDefinition](../../doc/api/location-custom-attributes.md#update-location-custom-attribute-definition) request. + +## Structure + +`UpdateLocationCustomAttributeDefinitionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttributeDefinition` | [`CustomAttributeDefinition`](../../doc/models/custom-attribute-definition.md) | Required | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | +| `idempotencyKey` | `string \| null \| undefined` | Optional | 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).
**Constraints**: *Maximum Length*: `45` | + +## Example (as JSON) + +```json +{ + "custom_attribute_definition": { + "description": "Update the description as desired.", + "visibility": "VISIBILITY_READ_ONLY", + "key": "key2", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name2" + }, + "idempotency_key": "idempotency_key2" +} +``` + diff --git a/legacy/doc/models/update-location-custom-attribute-definition-response.md b/legacy/doc/models/update-location-custom-attribute-definition-response.md new file mode 100644 index 000000000..a930b05e5 --- /dev/null +++ b/legacy/doc/models/update-location-custom-attribute-definition-response.md @@ -0,0 +1,57 @@ + +# Update Location Custom Attribute Definition Response + +Represents an [UpdateLocationCustomAttributeDefinition](../../doc/api/location-custom-attributes.md#update-location-custom-attribute-definition) response. +Either `custom_attribute_definition` or `errors` is present in the response. + +## Structure + +`UpdateLocationCustomAttributeDefinitionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttributeDefinition` | [`CustomAttributeDefinition \| undefined`](../../doc/models/custom-attribute-definition.md) | Optional | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "custom_attribute_definition": { + "created_at": "2022-12-02T19:06:36.559Z", + "description": "Update the description as desired.", + "key": "bestseller", + "name": "Bestseller", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "updated_at": "2022-12-02T19:34:10.181Z", + "version": 2, + "visibility": "VISIBILITY_READ_ONLY" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/update-location-request.md b/legacy/doc/models/update-location-request.md new file mode 100644 index 000000000..0114fccf5 --- /dev/null +++ b/legacy/doc/models/update-location-request.md @@ -0,0 +1,57 @@ + +# Update Location Request + +The request object for the [UpdateLocation](../../doc/api/locations.md#update-location) endpoint. + +## Structure + +`UpdateLocationRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `location` | [`Location \| undefined`](../../doc/models/location.md) | Optional | Represents one of a business' [locations](https://developer.squareup.com/docs/locations-api). | + +## Example (as JSON) + +```json +{ + "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", + "id": "id4", + "name": "name4", + "address": { + "address_line_1": "address_line_16", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "locality": "locality6", + "sublocality": "sublocality6" + }, + "timezone": "timezone6", + "capabilities": [ + "CREDIT_CARD_PROCESSING" + ] + } +} +``` + diff --git a/legacy/doc/models/update-location-response.md b/legacy/doc/models/update-location-response.md new file mode 100644 index 000000000..1ab5992ce --- /dev/null +++ b/legacy/doc/models/update-location-response.md @@ -0,0 +1,87 @@ + +# Update Location Response + +The response object returned by the [UpdateLocation](../../doc/api/locations.md#update-location) endpoint. + +## Structure + +`UpdateLocationResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information about errors encountered during the request. | +| `location` | [`Location \| undefined`](../../doc/models/location.md) | Optional | Represents one of a business' [locations](https://developer.squareup.com/docs/locations-api). | + +## Example (as JSON) + +```json +{ + "location": { + "address": { + "address_line_1": "1234 Peachtree St. NE", + "administrative_district_level_1": "GA", + "locality": "Atlanta", + "postal_code": "30309", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "sublocality": "sublocality6" + }, + "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" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/update-location-settings-request.md b/legacy/doc/models/update-location-settings-request.md new file mode 100644 index 000000000..d664a9b2b --- /dev/null +++ b/legacy/doc/models/update-location-settings-request.md @@ -0,0 +1,68 @@ + +# Update Location Settings Request + +## Structure + +`UpdateLocationSettingsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `locationSettings` | [`CheckoutLocationSettings`](../../doc/models/checkout-location-settings.md) | Required | - | + +## Example (as JSON) + +```json +{ + "location_settings": { + "location_id": "location_id0", + "customer_notes_enabled": false, + "policies": [ + { + "uid": "uid8", + "title": "title4", + "description": "description8" + }, + { + "uid": "uid8", + "title": "title4", + "description": "description8" + }, + { + "uid": "uid8", + "title": "title4", + "description": "description8" + } + ], + "branding": { + "header_type": "FULL_WIDTH_LOGO", + "button_color": "button_color2", + "button_shape": "PILL" + }, + "tipping": { + "percentages": [ + 246, + 247 + ], + "smart_tipping_enabled": false, + "default_percent": 46, + "smart_tips": [ + { + "amount": 152, + "currency": "GEL" + }, + { + "amount": 152, + "currency": "GEL" + } + ], + "default_smart_tip": { + "amount": 58, + "currency": "KWD" + } + } + } +} +``` + diff --git a/legacy/doc/models/update-location-settings-response.md b/legacy/doc/models/update-location-settings-response.md new file mode 100644 index 000000000..79ddd2a61 --- /dev/null +++ b/legacy/doc/models/update-location-settings-response.md @@ -0,0 +1,104 @@ + +# Update Location Settings Response + +## Structure + +`UpdateLocationSettingsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred when updating the location settings. | +| `locationSettings` | [`CheckoutLocationSettings \| undefined`](../../doc/models/checkout-location-settings.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "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" + } + ], + "smart_tips": [ + { + "amount": 152, + "currency": "GEL" + }, + { + "amount": 152, + "currency": "GEL" + } + ], + "default_smart_tip": { + "amount": 58, + "currency": "KWD" + } + }, + "updated_at": "2022-06-16T22:25:35Z" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/update-merchant-custom-attribute-definition-request.md b/legacy/doc/models/update-merchant-custom-attribute-definition-request.md new file mode 100644 index 000000000..de53405f7 --- /dev/null +++ b/legacy/doc/models/update-merchant-custom-attribute-definition-request.md @@ -0,0 +1,34 @@ + +# Update Merchant Custom Attribute Definition Request + +Represents an [UpdateMerchantCustomAttributeDefinition](../../doc/api/merchant-custom-attributes.md#update-merchant-custom-attribute-definition) request. + +## Structure + +`UpdateMerchantCustomAttributeDefinitionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttributeDefinition` | [`CustomAttributeDefinition`](../../doc/models/custom-attribute-definition.md) | Required | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | +| `idempotencyKey` | `string \| null \| undefined` | Optional | 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).
**Constraints**: *Maximum Length*: `45` | + +## Example (as JSON) + +```json +{ + "custom_attribute_definition": { + "description": "Update the description as desired.", + "visibility": "VISIBILITY_READ_ONLY", + "key": "key2", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name2" + }, + "idempotency_key": "idempotency_key4" +} +``` + diff --git a/legacy/doc/models/update-merchant-custom-attribute-definition-response.md b/legacy/doc/models/update-merchant-custom-attribute-definition-response.md new file mode 100644 index 000000000..bb89d8822 --- /dev/null +++ b/legacy/doc/models/update-merchant-custom-attribute-definition-response.md @@ -0,0 +1,45 @@ + +# Update Merchant Custom Attribute Definition Response + +Represents an [UpdateMerchantCustomAttributeDefinition](../../doc/api/merchant-custom-attributes.md#update-merchant-custom-attribute-definition) response. +Either `custom_attribute_definition` or `errors` is present in the response. + +## Structure + +`UpdateMerchantCustomAttributeDefinitionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttributeDefinition` | [`CustomAttributeDefinition \| undefined`](../../doc/models/custom-attribute-definition.md) | Optional | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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": { + "key1": "val1", + "key2": "val2" + }, + "updated_at": "2023-05-05T19:34:10.181Z", + "version": 2, + "visibility": "VISIBILITY_READ_ONLY" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/update-merchant-settings-request.md b/legacy/doc/models/update-merchant-settings-request.md new file mode 100644 index 000000000..6539283ec --- /dev/null +++ b/legacy/doc/models/update-merchant-settings-request.md @@ -0,0 +1,57 @@ + +# Update Merchant Settings Request + +## Structure + +`UpdateMerchantSettingsRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `merchantSettings` | [`CheckoutMerchantSettings`](../../doc/models/checkout-merchant-settings.md) | Required | - | + +## Example (as JSON) + +```json +{ + "merchant_settings": { + "payment_methods": { + "apple_pay": { + "enabled": false + }, + "google_pay": { + "enabled": false + }, + "cash_app": { + "enabled": false + }, + "afterpay_clearpay": { + "order_eligibility_range": { + "min": { + "amount": 34, + "currency": "OMR" + }, + "max": { + "amount": 140, + "currency": "JPY" + } + }, + "item_eligibility_range": { + "min": { + "amount": 34, + "currency": "OMR" + }, + "max": { + "amount": 140, + "currency": "JPY" + } + }, + "enabled": false + } + }, + "updated_at": "updated_at6" + } +} +``` + diff --git a/legacy/doc/models/update-merchant-settings-response.md b/legacy/doc/models/update-merchant-settings-response.md new file mode 100644 index 000000000..30ebba505 --- /dev/null +++ b/legacy/doc/models/update-merchant-settings-response.md @@ -0,0 +1,76 @@ + +# Update Merchant Settings Response + +## Structure + +`UpdateMerchantSettingsResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred when updating the merchant settings. | +| `merchantSettings` | [`CheckoutMerchantSettings \| undefined`](../../doc/models/checkout-merchant-settings.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "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 + }, + "cash_app": { + "enabled": false + } + }, + "updated_at": "2022-06-16T22:25:35Z" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/update-order-custom-attribute-definition-request.md b/legacy/doc/models/update-order-custom-attribute-definition-request.md new file mode 100644 index 000000000..ff6366e62 --- /dev/null +++ b/legacy/doc/models/update-order-custom-attribute-definition-request.md @@ -0,0 +1,35 @@ + +# Update Order Custom Attribute Definition Request + +Represents an update request for an order custom attribute definition. + +## Structure + +`UpdateOrderCustomAttributeDefinitionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttributeDefinition` | [`CustomAttributeDefinition`](../../doc/models/custom-attribute-definition.md) | Required | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | +| `idempotencyKey` | `string \| null \| undefined` | Optional | 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).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `45` | + +## Example (as JSON) + +```json +{ + "custom_attribute_definition": { + "key": "cover-count", + "version": 1, + "visibility": "VISIBILITY_READ_ONLY", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name2", + "description": "description8" + }, + "idempotency_key": "IDEMPOTENCY_KEY" +} +``` + diff --git a/legacy/doc/models/update-order-custom-attribute-definition-response.md b/legacy/doc/models/update-order-custom-attribute-definition-response.md new file mode 100644 index 000000000..6d66d694a --- /dev/null +++ b/legacy/doc/models/update-order-custom-attribute-definition-response.md @@ -0,0 +1,56 @@ + +# Update Order Custom Attribute Definition Response + +Represents a response from updating an order custom attribute definition. + +## Structure + +`UpdateOrderCustomAttributeDefinitionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttributeDefinition` | [`CustomAttributeDefinition \| undefined`](../../doc/models/custom-attribute-definition.md) | Optional | Represents a definition for custom attribute values. A custom attribute definition
specifies the key, visibility, schema, and other properties for a custom attribute. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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": { + "key1": "val1", + "key2": "val2" + }, + "updated_at": "2022-11-16T17:44:11.436Z", + "version": 2, + "visibility": "VISIBILITY_READ_ONLY" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/update-order-request.md b/legacy/doc/models/update-order-request.md new file mode 100644 index 000000000..0d9c4182e --- /dev/null +++ b/legacy/doc/models/update-order-request.md @@ -0,0 +1,64 @@ + +# Update Order Request + +Defines the fields that are included in requests to the +[UpdateOrder](../../doc/api/orders.md#update-order) endpoint. + +## Structure + +`UpdateOrderRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `order` | [`Order \| undefined`](../../doc/models/order.md) | Optional | 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. | +| `fieldsToClear` | `string[] \| null \| undefined` | Optional | 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). | +| `idempotencyKey` | `string \| null \| undefined` | Optional | 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).
**Constraints**: *Maximum Length*: `192` | + +## Example (as JSON) + +```json +{ + "order": { + "id": "id6", + "location_id": "location_id0", + "reference_id": "reference_id4", + "source": { + "name": "name4" + }, + "customer_id": "customer_id4", + "line_items": [ + { + "uid": "uid8", + "name": "name8", + "quantity": "quantity4", + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note4", + "catalog_object_id": "catalog_object_id2" + } + ] + }, + "fields_to_clear": [ + "fields_to_clear7", + "fields_to_clear8", + "fields_to_clear9" + ], + "idempotency_key": "idempotency_key2" +} +``` + diff --git a/legacy/doc/models/update-order-response.md b/legacy/doc/models/update-order-response.md new file mode 100644 index 000000000..a6722bd3f --- /dev/null +++ b/legacy/doc/models/update-order-response.md @@ -0,0 +1,187 @@ + +# Update Order Response + +Defines the fields that are included in the response body of +a request to the [UpdateOrder](../../doc/api/orders.md#update-order) endpoint. + +## Structure + +`UpdateOrderResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `order` | [`Order \| undefined`](../../doc/models/order.md) | Optional | 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. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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" + }, + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note4", + "catalog_object_id": "catalog_object_id2" + }, + { + "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" + }, + "quantity_unit": { + "measurement_unit": { + "custom_unit": { + "name": "name2", + "abbreviation": "abbreviation4" + }, + "area_unit": "IMPERIAL_ACRE", + "length_unit": "IMPERIAL_INCH", + "volume_unit": "METRIC_LITER", + "weight_unit": "IMPERIAL_WEIGHT_OUNCE" + }, + "precision": 54, + "catalog_object_id": "catalog_object_id0", + "catalog_version": 12 + }, + "note": "note4", + "catalog_object_id": "catalog_object_id2" + } + ], + "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, + "reference_id": "reference_id4", + "customer_id": "customer_id4" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/update-payment-link-request.md b/legacy/doc/models/update-payment-link-request.md new file mode 100644 index 000000000..4032846b9 --- /dev/null +++ b/legacy/doc/models/update-payment-link-request.md @@ -0,0 +1,52 @@ + +# Update Payment Link Request + +## Structure + +`UpdatePaymentLinkRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `paymentLink` | [`PaymentLink`](../../doc/models/payment-link.md) | Required | - | + +## Example (as JSON) + +```json +{ + "payment_link": { + "checkout_options": { + "ask_for_shipping_address": true, + "allow_tipping": false, + "custom_fields": [ + { + "title": "title8" + }, + { + "title": "title8" + } + ], + "subscription_plan_id": "subscription_plan_id8", + "redirect_url": "redirect_url2", + "merchant_support_email": "merchant_support_email8" + }, + "version": 1, + "id": "id2", + "description": "description2", + "order_id": "order_id6", + "pre_populated_data": { + "buyer_email": "buyer_email8", + "buyer_phone_number": "buyer_phone_number0", + "buyer_address": { + "address_line_1": "address_line_12", + "address_line_2": "address_line_22", + "address_line_3": "address_line_38", + "locality": "locality2", + "sublocality": "sublocality2" + } + } + } +} +``` + diff --git a/legacy/doc/models/update-payment-link-response.md b/legacy/doc/models/update-payment-link-response.md new file mode 100644 index 000000000..4d2b24099 --- /dev/null +++ b/legacy/doc/models/update-payment-link-response.md @@ -0,0 +1,78 @@ + +# Update Payment Link Response + +## Structure + +`UpdatePaymentLinkResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred when updating the payment link. | +| `paymentLink` | [`PaymentLink \| undefined`](../../doc/models/payment-link.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "payment_link": { + "checkout_options": { + "ask_for_shipping_address": true, + "allow_tipping": false, + "custom_fields": [ + { + "title": "title8" + }, + { + "title": "title8" + } + ], + "subscription_plan_id": "subscription_plan_id8", + "redirect_url": "redirect_url2", + "merchant_support_email": "merchant_support_email8" + }, + "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, + "description": "description2", + "pre_populated_data": { + "buyer_email": "buyer_email8", + "buyer_phone_number": "buyer_phone_number0", + "buyer_address": { + "address_line_1": "address_line_12", + "address_line_2": "address_line_22", + "address_line_3": "address_line_38", + "locality": "locality2", + "sublocality": "sublocality2" + } + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/update-payment-request.md b/legacy/doc/models/update-payment-request.md new file mode 100644 index 000000000..7488f4429 --- /dev/null +++ b/legacy/doc/models/update-payment-request.md @@ -0,0 +1,39 @@ + +# Update Payment Request + +Describes a request to update a payment using +[UpdatePayment](../../doc/api/payments.md#update-payment). + +## Structure + +`UpdatePaymentRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `payment` | [`Payment \| undefined`](../../doc/models/payment.md) | Optional | Represents a payment processed by the Square API. | +| `idempotencyKey` | `string` | Required | 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).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `45` | + +## Example (as JSON) + +```json +{ + "idempotency_key": "956f8b13-e4ec-45d6-85e8-d1d95ef0c5de", + "payment": { + "amount_money": { + "amount": 1000, + "currency": "USD" + }, + "tip_money": { + "amount": 100, + "currency": "USD" + }, + "version_token": "ODhwVQ35xwlzRuoZEwKXucfu7583sPTzK48c5zoGd0g6o", + "id": "id6", + "created_at": "created_at4", + "updated_at": "updated_at2" + } +} +``` + diff --git a/legacy/doc/models/update-payment-response.md b/legacy/doc/models/update-payment-response.md new file mode 100644 index 000000000..48b72fb11 --- /dev/null +++ b/legacy/doc/models/update-payment-response.md @@ -0,0 +1,111 @@ + +# Update Payment Response + +Defines the response returned by +[UpdatePayment](../../doc/api/payments.md#update-payment). + +## Structure + +`UpdatePaymentResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `payment` | [`Payment \| undefined`](../../doc/models/payment.md) | Optional | Represents a payment processed by the Square API. | + +## Example (as JSON) + +```json +{ + "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" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/update-shift-request.md b/legacy/doc/models/update-shift-request.md new file mode 100644 index 000000000..ab1d3a411 --- /dev/null +++ b/legacy/doc/models/update-shift-request.md @@ -0,0 +1,56 @@ + +# Update Shift Request + +A request to update a `Shift` object. + +## Structure + +`UpdateShiftRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `shift` | [`Shift`](../../doc/models/shift.md) | Required | 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. | + +## Example (as JSON) + +```json +{ + "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", + "job_id": "job_id0" + }, + "id": "id4", + "employee_id": "employee_id4", + "timezone": "timezone4" + } +} +``` + diff --git a/legacy/doc/models/update-shift-response.md b/legacy/doc/models/update-shift-response.md new file mode 100644 index 000000000..0316c880f --- /dev/null +++ b/legacy/doc/models/update-shift-response.md @@ -0,0 +1,82 @@ + +# Update Shift Response + +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. + +## Structure + +`UpdateShiftResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `shift` | [`Shift \| undefined`](../../doc/models/shift.md) | Optional | 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. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/update-subscription-request.md b/legacy/doc/models/update-subscription-request.md new file mode 100644 index 000000000..2cfe23597 --- /dev/null +++ b/legacy/doc/models/update-subscription-request.md @@ -0,0 +1,32 @@ + +# Update Subscription Request + +Defines input parameters in a request to the +[UpdateSubscription](../../doc/api/subscriptions.md#update-subscription) endpoint. + +## Structure + +`UpdateSubscriptionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscription` | [`Subscription \| undefined`](../../doc/models/subscription.md) | Optional | Represents a subscription purchased by a customer.

For more information, see
[Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). | + +## Example (as JSON) + +```json +{ + "subscription": { + "canceled_date": null, + "card_id": "{NEW CARD ID}", + "id": "id4", + "location_id": "location_id8", + "plan_variation_id": "plan_variation_id8", + "customer_id": "customer_id2", + "start_date": "start_date8" + } +} +``` + diff --git a/legacy/doc/models/update-subscription-response.md b/legacy/doc/models/update-subscription-response.md new file mode 100644 index 000000000..bc90653bc --- /dev/null +++ b/legacy/doc/models/update-subscription-response.md @@ -0,0 +1,58 @@ + +# Update Subscription Response + +Defines output parameters in a response from the +[UpdateSubscription](../../doc/api/subscriptions.md#update-subscription) endpoint. + +## Structure + +`UpdateSubscriptionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Errors encountered during the request. | +| `subscription` | [`Subscription \| undefined`](../../doc/models/subscription.md) | Optional | Represents a subscription purchased by a customer.

For more information, see
[Manage Subscriptions](https://developer.squareup.com/docs/subscriptions-api/manage-subscriptions). | + +## Example (as JSON) + +```json +{ + "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 + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/update-team-member-request.md b/legacy/doc/models/update-team-member-request.md new file mode 100644 index 000000000..f3a6bee0f --- /dev/null +++ b/legacy/doc/models/update-team-member-request.md @@ -0,0 +1,61 @@ + +# Update Team Member Request + +Represents an update request for a `TeamMember` object. + +## Structure + +`UpdateTeamMemberRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `teamMember` | [`TeamMember \| undefined`](../../doc/models/team-member.md) | Optional | A record representing an individual team member for a business. | + +## Example (as JSON) + +```json +{ + "team_member": { + "assigned_locations": { + "assignment_type": "EXPLICIT_LOCATIONS", + "location_ids": [ + "YSGH2WBKG94QZ", + "GA2Y9HSJ8KRYT" + ], + "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" + } + ] + } + }, + "email_address": "joe_doe@gmail.com", + "family_name": "Doe", + "given_name": "Joe", + "phone_number": "+14159283333", + "reference_id": "reference_id_1", + "status": "ACTIVE", + "id": "id6", + "is_owner": false + } +} +``` + diff --git a/legacy/doc/models/update-team-member-response.md b/legacy/doc/models/update-team-member-response.md new file mode 100644 index 000000000..822f51e73 --- /dev/null +++ b/legacy/doc/models/update-team-member-response.md @@ -0,0 +1,82 @@ + +# Update Team Member Response + +Represents a response from an update request containing the updated `TeamMember` object or error messages. + +## Structure + +`UpdateTeamMemberResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `teamMember` | [`TeamMember \| undefined`](../../doc/models/team-member.md) | Optional | A record representing an individual team member for a business. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | The errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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 + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/update-vendor-request.md b/legacy/doc/models/update-vendor-request.md new file mode 100644 index 000000000..51e811e37 --- /dev/null +++ b/legacy/doc/models/update-vendor-request.md @@ -0,0 +1,39 @@ + +# Update Vendor Request + +Represents an input to a call to [UpdateVendor](../../doc/api/vendors.md#update-vendor). + +## Structure + +`UpdateVendorRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string \| null \| undefined` | Optional | 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.
**Constraints**: *Maximum Length*: `128` | +| `vendor` | [`Vendor`](../../doc/models/vendor.md) | Required | Represents a supplier to a seller. | + +## Example (as JSON) + +```json +{ + "idempotency_key": "8fc6a5b0-9fe8-4b46-b46b-2ef95793abbe", + "vendor": { + "id": "INV_V_JDKYHBWT1D4F8MFH63DBMEN8Y4", + "name": "Jack's Chicken Shack", + "status": "ACTIVE", + "version": 1, + "created_at": "created_at4", + "updated_at": "updated_at2", + "address": { + "address_line_1": "address_line_16", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "locality": "locality6", + "sublocality": "sublocality6" + } + } +} +``` + diff --git a/legacy/doc/models/update-vendor-response.md b/legacy/doc/models/update-vendor-response.md new file mode 100644 index 000000000..b0c95058b --- /dev/null +++ b/legacy/doc/models/update-vendor-response.md @@ -0,0 +1,71 @@ + +# Update Vendor Response + +Represents an output from a call to [UpdateVendor](../../doc/api/vendors.md#update-vendor). + +## Structure + +`UpdateVendorResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Errors occurred when the request fails. | +| `vendor` | [`Vendor \| undefined`](../../doc/models/vendor.md) | Optional | Represents a supplier to a seller. | + +## Example (as JSON) + +```json +{ + "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", + "address_line_3": "address_line_32", + "sublocality": "sublocality6" + }, + "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 + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/update-wage-setting-request.md b/legacy/doc/models/update-wage-setting-request.md new file mode 100644 index 000000000..0430dd4f8 --- /dev/null +++ b/legacy/doc/models/update-wage-setting-request.md @@ -0,0 +1,58 @@ + +# Update Wage Setting Request + +Represents an update request for the `WageSetting` object describing a `TeamMember`. + +## Structure + +`UpdateWageSettingRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `wageSetting` | [`WageSetting`](../../doc/models/wage-setting.md) | Required | Represents information about the overtime exemption status, job assignments, and compensation
for a [team member](../../doc/models/team-member.md). | + +## Example (as JSON) + +```json +{ + "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": 172, + "currency": "LAK" + }, + "job_id": "job_id2" + }, + { + "hourly_rate": { + "amount": 2000, + "currency": "USD" + }, + "job_title": "Cashier", + "pay_type": "HOURLY", + "annual_rate": { + "amount": 232, + "currency": "NIO" + }, + "weekly_hours": 98, + "job_id": "job_id2" + } + ], + "team_member_id": "team_member_id8", + "version": 130, + "created_at": "created_at6" + } +} +``` + diff --git a/legacy/doc/models/update-wage-setting-response.md b/legacy/doc/models/update-wage-setting-response.md new file mode 100644 index 000000000..aa73897ce --- /dev/null +++ b/legacy/doc/models/update-wage-setting-response.md @@ -0,0 +1,75 @@ + +# Update Wage Setting Response + +Represents a response from an update request containing the updated `WageSetting` object +or error messages. + +## Structure + +`UpdateWageSettingResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `wageSetting` | [`WageSetting \| undefined`](../../doc/models/wage-setting.md) | Optional | Represents information about the overtime exemption status, job assignments, and compensation
for a [team member](../../doc/models/team-member.md). | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | The errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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, + "job_id": "job_id2" + }, + { + "hourly_rate": { + "amount": 2000, + "currency": "USD" + }, + "job_title": "Cashier", + "pay_type": "HOURLY", + "annual_rate": { + "amount": 232, + "currency": "NIO" + }, + "weekly_hours": 98, + "job_id": "job_id2" + } + ], + "team_member_id": "-3oZQKPKVk6gUXU_V5Qa", + "updated_at": "2020-06-11T23:12:04+00:00", + "version": 1 + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/update-webhook-subscription-request.md b/legacy/doc/models/update-webhook-subscription-request.md new file mode 100644 index 000000000..8ff3e357f --- /dev/null +++ b/legacy/doc/models/update-webhook-subscription-request.md @@ -0,0 +1,32 @@ + +# Update Webhook Subscription Request + +Updates a [Subscription](../../doc/models/webhook-subscription.md). + +## Structure + +`UpdateWebhookSubscriptionRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `subscription` | [`WebhookSubscription \| undefined`](../../doc/models/webhook-subscription.md) | Optional | Represents the details of a webhook subscription, including notification URL,
event types, and signature key. | + +## Example (as JSON) + +```json +{ + "subscription": { + "enabled": false, + "name": "Updated Example Webhook Subscription", + "id": "id4", + "event_types": [ + "event_types2", + "event_types3" + ], + "notification_url": "notification_url8" + } +} +``` + diff --git a/legacy/doc/models/update-webhook-subscription-response.md b/legacy/doc/models/update-webhook-subscription-response.md new file mode 100644 index 000000000..e055ceac6 --- /dev/null +++ b/legacy/doc/models/update-webhook-subscription-response.md @@ -0,0 +1,48 @@ + +# Update Webhook Subscription Response + +Defines the fields that are included in the response body of +a request to the [UpdateWebhookSubscription](../../doc/api/webhook-subscriptions.md#update-webhook-subscription) endpoint. + +Note: If there are errors processing the request, the [Subscription](../../doc/models/webhook-subscription.md) is not +present. + +## Structure + +`UpdateWebhookSubscriptionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | +| `subscription` | [`WebhookSubscription \| undefined`](../../doc/models/webhook-subscription.md) | Optional | Represents the details of a webhook subscription, including notification URL,
event types, and signature key. | + +## Example (as JSON) + +```json +{ + "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" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/update-webhook-subscription-signature-key-request.md b/legacy/doc/models/update-webhook-subscription-signature-key-request.md new file mode 100644 index 000000000..99e1fc85f --- /dev/null +++ b/legacy/doc/models/update-webhook-subscription-signature-key-request.md @@ -0,0 +1,23 @@ + +# Update Webhook Subscription Signature Key Request + +Updates a [Subscription](../../doc/models/webhook-subscription.md) by replacing the existing signature key with a new one. + +## Structure + +`UpdateWebhookSubscriptionSignatureKeyRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string \| null \| undefined` | Optional | A unique string that identifies the [UpdateWebhookSubscriptionSignatureKey](api-endpoint:WebhookSubscriptions-UpdateWebhookSubscriptionSignatureKey) request.
**Constraints**: *Maximum Length*: `45` | + +## Example (as JSON) + +```json +{ + "idempotency_key": "ed80ae6b-0654-473b-bbab-a39aee89a60d" +} +``` + diff --git a/legacy/doc/models/update-webhook-subscription-signature-key-response.md b/legacy/doc/models/update-webhook-subscription-signature-key-response.md new file mode 100644 index 000000000..198abf75b --- /dev/null +++ b/legacy/doc/models/update-webhook-subscription-signature-key-response.md @@ -0,0 +1,48 @@ + +# Update Webhook Subscription Signature Key Response + +Defines the fields that are included in the response body of +a request to the [UpdateWebhookSubscriptionSignatureKey](../../doc/api/webhook-subscriptions.md#update-webhook-subscription-signature-key) endpoint. + +Note: If there are errors processing the request, the [Subscription](../../doc/models/webhook-subscription.md) is not +present. + +## Structure + +`UpdateWebhookSubscriptionSignatureKeyResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Information on errors encountered during the request. | +| `signatureKey` | `string \| undefined` | Optional | The new Square-generated signature key used to validate the origin of the webhook event. | + +## Example (as JSON) + +```json +{ + "signature_key": "1k9bIJKCeTmSQwyagtNRLg", + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/update-workweek-config-request.md b/legacy/doc/models/update-workweek-config-request.md new file mode 100644 index 000000000..d72b936be --- /dev/null +++ b/legacy/doc/models/update-workweek-config-request.md @@ -0,0 +1,30 @@ + +# Update Workweek Config Request + +A request to update a `WorkweekConfig` object. + +## Structure + +`UpdateWorkweekConfigRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `workweekConfig` | [`WorkweekConfig`](../../doc/models/workweek-config.md) | Required | Sets the day of the week and hour of the day that a business starts a
workweek. This is used to calculate overtime pay. | + +## Example (as JSON) + +```json +{ + "workweek_config": { + "start_of_day_local_time": "10:00", + "start_of_week": "MON", + "version": 10, + "id": "id0", + "created_at": "created_at8", + "updated_at": "updated_at6" + } +} +``` + diff --git a/legacy/doc/models/update-workweek-config-response.md b/legacy/doc/models/update-workweek-config-response.md new file mode 100644 index 000000000..d2946e94b --- /dev/null +++ b/legacy/doc/models/update-workweek-config-response.md @@ -0,0 +1,53 @@ + +# Update Workweek Config Response + +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. + +## Structure + +`UpdateWorkweekConfigResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `workweekConfig` | [`WorkweekConfig \| undefined`](../../doc/models/workweek-config.md) | Optional | Sets the day of the week and hour of the day that a business starts a
workweek. This is used to calculate overtime pay. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "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 + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/upsert-booking-custom-attribute-request.md b/legacy/doc/models/upsert-booking-custom-attribute-request.md new file mode 100644 index 000000000..8d91a27c4 --- /dev/null +++ b/legacy/doc/models/upsert-booking-custom-attribute-request.md @@ -0,0 +1,43 @@ + +# Upsert Booking Custom Attribute Request + +Represents an [UpsertBookingCustomAttribute](../../doc/api/booking-custom-attributes.md#upsert-booking-custom-attribute) request. + +## Structure + +`UpsertBookingCustomAttributeRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttribute` | [`CustomAttribute`](../../doc/models/custom-attribute.md) | Required | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | +| `idempotencyKey` | `string \| null \| undefined` | Optional | 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).
**Constraints**: *Maximum Length*: `45` | + +## Example (as JSON) + +```json +{ + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "idempotency_key": "idempotency_key4" +} +``` + diff --git a/legacy/doc/models/upsert-booking-custom-attribute-response.md b/legacy/doc/models/upsert-booking-custom-attribute-response.md new file mode 100644 index 000000000..393e27db3 --- /dev/null +++ b/legacy/doc/models/upsert-booking-custom-attribute-response.md @@ -0,0 +1,63 @@ + +# Upsert Booking Custom Attribute Response + +Represents an [UpsertBookingCustomAttribute](../../doc/api/booking-custom-attributes.md#upsert-booking-custom-attribute) response. +Either `custom_attribute_definition` or `errors` is present in the response. + +## Structure + +`UpsertBookingCustomAttributeResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttribute` | [`CustomAttribute \| undefined`](../../doc/models/custom-attribute.md) | Optional | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/upsert-catalog-object-request.md b/legacy/doc/models/upsert-catalog-object-request.md new file mode 100644 index 000000000..1b2bf539b --- /dev/null +++ b/legacy/doc/models/upsert-catalog-object-request.md @@ -0,0 +1,80 @@ + +# Upsert Catalog Object Request + +## Structure + +`UpsertCatalogObjectRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `idempotencyKey` | `string` | Required | 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.
**Constraints**: *Minimum Length*: `1` | +| `object` | [`CatalogObject`](../../doc/models/catalog-object.md) | Required | 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. | + +## Example (as JSON) + +```json +{ + "idempotency_key": "af3d1afc-7212-4300-b463-0bfc5314a5ae", + "object": { + "id": "#Cocoa", + "item_data": { + "abbreviation": "Ch", + "description_html": "

Hot Chocolate

", + "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", + "updated_at": "updated_at8", + "version": 4, + "is_deleted": false, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] + } +} +``` + diff --git a/legacy/doc/models/upsert-catalog-object-response.md b/legacy/doc/models/upsert-catalog-object-response.md new file mode 100644 index 000000000..7ae4600a9 --- /dev/null +++ b/legacy/doc/models/upsert-catalog-object-response.md @@ -0,0 +1,139 @@ + +# Upsert Catalog Object Response + +## Structure + +`UpsertCatalogObjectResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `catalogObject` | [`CatalogObject \| undefined`](../../doc/models/catalog-object.md) | Optional | 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. | +| `idMappings` | [`CatalogIdMapping[] \| undefined`](../../doc/models/catalog-id-mapping.md) | Optional | The mapping between client and server IDs for this upsert. | + +## Example (as JSON) + +```json +{ + "catalog_object": { + "id": "R2TA2FOBUGCJZNIWJSOSNAI4", + "is_deleted": false, + "item_data": { + "abbreviation": "Ch", + "description": "Hot Chocolate", + "description_html": "

Hot Chocolate

", + "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, + "custom_attribute_values": { + "key0": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key1": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + }, + "key2": { + "name": "name8", + "string_value": "string_value2", + "custom_attribute_definition_id": "custom_attribute_definition_id4", + "type": "STRING", + "number_value": "number_value8" + } + }, + "catalog_v1_ids": [ + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + }, + { + "catalog_v1_id": "catalog_v1_id4", + "location_id": "location_id4" + } + ] + }, + "id_mappings": [ + { + "client_object_id": "#Cocoa", + "object_id": "R2TA2FOBUGCJZNIWJSOSNAI4" + }, + { + "client_object_id": "#Small", + "object_id": "QRT53UP4LITLWGOGBZCUWP63" + }, + { + "client_object_id": "#Large", + "object_id": "NS77DKEIQ3AEQTCP727DSA7U" + } + ], + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/upsert-customer-custom-attribute-request.md b/legacy/doc/models/upsert-customer-custom-attribute-request.md new file mode 100644 index 000000000..0caa85f26 --- /dev/null +++ b/legacy/doc/models/upsert-customer-custom-attribute-request.md @@ -0,0 +1,43 @@ + +# Upsert Customer Custom Attribute Request + +Represents an [UpsertCustomerCustomAttribute](../../doc/api/customer-custom-attributes.md#upsert-customer-custom-attribute) request. + +## Structure + +`UpsertCustomerCustomAttributeRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttribute` | [`CustomAttribute`](../../doc/models/custom-attribute.md) | Required | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | +| `idempotencyKey` | `string \| null \| undefined` | Optional | 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).
**Constraints**: *Maximum Length*: `45` | + +## Example (as JSON) + +```json +{ + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "idempotency_key": "idempotency_key6" +} +``` + diff --git a/legacy/doc/models/upsert-customer-custom-attribute-response.md b/legacy/doc/models/upsert-customer-custom-attribute-response.md new file mode 100644 index 000000000..3d321ceb8 --- /dev/null +++ b/legacy/doc/models/upsert-customer-custom-attribute-response.md @@ -0,0 +1,51 @@ + +# Upsert Customer Custom Attribute Response + +Represents an [UpsertCustomerCustomAttribute](../../doc/api/customer-custom-attributes.md#upsert-customer-custom-attribute) response. +Either `custom_attribute_definition` or `errors` is present in the response. + +## Structure + +`UpsertCustomerCustomAttributeResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttribute` | [`CustomAttribute \| undefined`](../../doc/models/custom-attribute.md) | Optional | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/upsert-location-custom-attribute-request.md b/legacy/doc/models/upsert-location-custom-attribute-request.md new file mode 100644 index 000000000..754bfc026 --- /dev/null +++ b/legacy/doc/models/upsert-location-custom-attribute-request.md @@ -0,0 +1,43 @@ + +# Upsert Location Custom Attribute Request + +Represents an [UpsertLocationCustomAttribute](../../doc/api/location-custom-attributes.md#upsert-location-custom-attribute) request. + +## Structure + +`UpsertLocationCustomAttributeRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttribute` | [`CustomAttribute`](../../doc/models/custom-attribute.md) | Required | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | +| `idempotencyKey` | `string \| null \| undefined` | Optional | 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).
**Constraints**: *Maximum Length*: `45` | + +## Example (as JSON) + +```json +{ + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "idempotency_key": "idempotency_key8" +} +``` + diff --git a/legacy/doc/models/upsert-location-custom-attribute-response.md b/legacy/doc/models/upsert-location-custom-attribute-response.md new file mode 100644 index 000000000..f9b4c49f3 --- /dev/null +++ b/legacy/doc/models/upsert-location-custom-attribute-response.md @@ -0,0 +1,57 @@ + +# Upsert Location Custom Attribute Response + +Represents an [UpsertLocationCustomAttribute](../../doc/api/location-custom-attributes.md#upsert-location-custom-attribute) response. +Either `custom_attribute_definition` or `errors` is present in the response. + +## Structure + +`UpsertLocationCustomAttributeResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttribute` | [`CustomAttribute \| undefined`](../../doc/models/custom-attribute.md) | Optional | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/upsert-merchant-custom-attribute-request.md b/legacy/doc/models/upsert-merchant-custom-attribute-request.md new file mode 100644 index 000000000..fdfc1df5c --- /dev/null +++ b/legacy/doc/models/upsert-merchant-custom-attribute-request.md @@ -0,0 +1,43 @@ + +# Upsert Merchant Custom Attribute Request + +Represents an [UpsertMerchantCustomAttribute](../../doc/api/merchant-custom-attributes.md#upsert-merchant-custom-attribute) request. + +## Structure + +`UpsertMerchantCustomAttributeRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttribute` | [`CustomAttribute`](../../doc/models/custom-attribute.md) | Required | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | +| `idempotencyKey` | `string \| null \| undefined` | Optional | 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).
**Constraints**: *Maximum Length*: `45` | + +## Example (as JSON) + +```json +{ + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "idempotency_key": "idempotency_key6" +} +``` + diff --git a/legacy/doc/models/upsert-merchant-custom-attribute-response.md b/legacy/doc/models/upsert-merchant-custom-attribute-response.md new file mode 100644 index 000000000..e4b1a55bb --- /dev/null +++ b/legacy/doc/models/upsert-merchant-custom-attribute-response.md @@ -0,0 +1,51 @@ + +# Upsert Merchant Custom Attribute Response + +Represents an [UpsertMerchantCustomAttribute](../../doc/api/merchant-custom-attributes.md#upsert-merchant-custom-attribute) response. +Either `custom_attribute_definition` or `errors` is present in the response. + +## Structure + +`UpsertMerchantCustomAttributeResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttribute` | [`CustomAttribute \| undefined`](../../doc/models/custom-attribute.md) | Optional | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/upsert-order-custom-attribute-request.md b/legacy/doc/models/upsert-order-custom-attribute-request.md new file mode 100644 index 000000000..8e88e5dbe --- /dev/null +++ b/legacy/doc/models/upsert-order-custom-attribute-request.md @@ -0,0 +1,43 @@ + +# Upsert Order Custom Attribute Request + +Represents an upsert request for an order custom attribute. + +## Structure + +`UpsertOrderCustomAttributeRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttribute` | [`CustomAttribute`](../../doc/models/custom-attribute.md) | Required | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | +| `idempotencyKey` | `string \| null \| undefined` | Optional | 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).
**Constraints**: *Minimum Length*: `1`, *Maximum Length*: `45` | + +## Example (as JSON) + +```json +{ + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "idempotency_key": "idempotency_key4" +} +``` + diff --git a/legacy/doc/models/upsert-order-custom-attribute-response.md b/legacy/doc/models/upsert-order-custom-attribute-response.md new file mode 100644 index 000000000..c641b0267 --- /dev/null +++ b/legacy/doc/models/upsert-order-custom-attribute-response.md @@ -0,0 +1,62 @@ + +# Upsert Order Custom Attribute Response + +Represents a response from upserting order custom attribute definitions. + +## Structure + +`UpsertOrderCustomAttributeResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `customAttribute` | [`CustomAttribute \| undefined`](../../doc/models/custom-attribute.md) | Optional | A custom attribute value. Each custom attribute value has a corresponding
`CustomAttributeDefinition` object. | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "custom_attribute": { + "key": "key2", + "value": { + "key1": "val1", + "key2": "val2" + }, + "version": 102, + "visibility": "VISIBILITY_READ_ONLY", + "definition": { + "key": "key0", + "schema": { + "key1": "val1", + "key2": "val2" + }, + "name": "name0", + "description": "description0", + "visibility": "VISIBILITY_HIDDEN" + } + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/upsert-snippet-request.md b/legacy/doc/models/upsert-snippet-request.md new file mode 100644 index 000000000..8856b05be --- /dev/null +++ b/legacy/doc/models/upsert-snippet-request.md @@ -0,0 +1,29 @@ + +# Upsert Snippet Request + +Represents an `UpsertSnippet` request. + +## Structure + +`UpsertSnippetRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `snippet` | [`Snippet`](../../doc/models/snippet.md) | Required | 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. | + +## Example (as JSON) + +```json +{ + "snippet": { + "content": "", + "id": "id0", + "site_id": "site_id6", + "created_at": "created_at8", + "updated_at": "updated_at4" + } +} +``` + diff --git a/legacy/doc/models/upsert-snippet-response.md b/legacy/doc/models/upsert-snippet-response.md new file mode 100644 index 000000000..98544fbc4 --- /dev/null +++ b/legacy/doc/models/upsert-snippet-response.md @@ -0,0 +1,44 @@ + +# Upsert Snippet Response + +Represents an `UpsertSnippet` response. The response can include either `snippet` or `errors`. + +## Structure + +`UpsertSnippetResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `snippet` | [`Snippet \| undefined`](../../doc/models/snippet.md) | Optional | 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. | + +## Example (as JSON) + +```json +{ + "snippet": { + "content": "", + "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" + }, + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/v1-device.md b/legacy/doc/models/v1-device.md new file mode 100644 index 000000000..76412bd3b --- /dev/null +++ b/legacy/doc/models/v1-device.md @@ -0,0 +1,23 @@ + +# V1 Device + +## Structure + +`V1Device` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | The device's Square-issued ID. | +| `name` | `string \| null \| undefined` | Optional | The device's merchant-specified name. | + +## Example (as JSON) + +```json +{ + "id": "id6", + "name": "name6" +} +``` + diff --git a/legacy/doc/models/v1-list-orders-request.md b/legacy/doc/models/v1-list-orders-request.md new file mode 100644 index 000000000..914f8386a --- /dev/null +++ b/legacy/doc/models/v1-list-orders-request.md @@ -0,0 +1,25 @@ + +# V1 List Orders Request + +## Structure + +`V1ListOrdersRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `order` | [`string \| undefined`](../../doc/models/sort-order.md) | Optional | The order (e.g., chronological or alphabetical) in which results from a request are returned. | +| `limit` | `number \| null \| undefined` | Optional | The maximum number of payments to return in a single response. This value cannot exceed 200. | +| `batchToken` | `string \| null \| undefined` | Optional | A pagination cursor to retrieve the next set of results for your
original query to the endpoint. | + +## Example (as JSON) + +```json +{ + "order": "DESC", + "limit": 24, + "batch_token": "batch_token4" +} +``` + diff --git a/legacy/doc/models/v1-list-orders-response.md b/legacy/doc/models/v1-list-orders-response.md new file mode 100644 index 000000000..e4b55c446 --- /dev/null +++ b/legacy/doc/models/v1-list-orders-response.md @@ -0,0 +1,50 @@ + +# V1 List Orders Response + +## Structure + +`V1ListOrdersResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `items` | [`V1Order[] \| undefined`](../../doc/models/v1-order.md) | Optional | - | + +## Example (as JSON) + +```json +{ + "items": [ + { + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "id": "id8", + "buyer_email": "buyer_email0", + "recipient_name": "recipient_name6", + "recipient_phone_number": "recipient_phone_number6" + }, + { + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "id": "id8", + "buyer_email": "buyer_email0", + "recipient_name": "recipient_name6", + "recipient_phone_number": "recipient_phone_number6" + } + ] +} +``` + diff --git a/legacy/doc/models/v1-money.md b/legacy/doc/models/v1-money.md new file mode 100644 index 000000000..e6540cb73 --- /dev/null +++ b/legacy/doc/models/v1-money.md @@ -0,0 +1,23 @@ + +# V1 Money + +## Structure + +`V1Money` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `amount` | `number \| null \| undefined` | Optional | 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). | +| `currencyCode` | [`string \| undefined`](../../doc/models/currency.md) | Optional | Indicates the associated currency for an amount of money. Values correspond
to [ISO 4217](https://wikipedia.org/wiki/ISO_4217). | + +## Example (as JSON) + +```json +{ + "amount": 24, + "currency_code": "XPT" +} +``` + diff --git a/legacy/doc/models/v1-order-history-entry-action.md b/legacy/doc/models/v1-order-history-entry-action.md new file mode 100644 index 000000000..1d9f6752c --- /dev/null +++ b/legacy/doc/models/v1-order-history-entry-action.md @@ -0,0 +1,19 @@ + +# V1 Order History Entry Action + +## Enumeration + +`V1OrderHistoryEntryAction` + +## Fields + +| Name | +| --- | +| `ORDER_PLACED` | +| `DECLINED` | +| `PAYMENT_RECEIVED` | +| `CANCELED` | +| `COMPLETED` | +| `REFUNDED` | +| `EXPIRED` | + diff --git a/legacy/doc/models/v1-order-history-entry.md b/legacy/doc/models/v1-order-history-entry.md new file mode 100644 index 000000000..191bd24f8 --- /dev/null +++ b/legacy/doc/models/v1-order-history-entry.md @@ -0,0 +1,25 @@ + +# V1 Order History Entry + +V1OrderHistoryEntry + +## Structure + +`V1OrderHistoryEntry` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `action` | [`string \| undefined`](../../doc/models/v1-order-history-entry-action.md) | Optional | - | +| `createdAt` | `string \| undefined` | Optional | The time when the action was performed, in ISO 8601 format. | + +## Example (as JSON) + +```json +{ + "action": "EXPIRED", + "created_at": "created_at8" +} +``` + diff --git a/legacy/doc/models/v1-order-state.md b/legacy/doc/models/v1-order-state.md new file mode 100644 index 000000000..ed04b532a --- /dev/null +++ b/legacy/doc/models/v1-order-state.md @@ -0,0 +1,18 @@ + +# V1 Order State + +## Enumeration + +`V1OrderState` + +## Fields + +| Name | +| --- | +| `PENDING` | +| `OPEN` | +| `COMPLETED` | +| `CANCELED` | +| `REFUNDED` | +| `REJECTED` | + diff --git a/legacy/doc/models/v1-order.md b/legacy/doc/models/v1-order.md new file mode 100644 index 000000000..8cf7d3b57 --- /dev/null +++ b/legacy/doc/models/v1-order.md @@ -0,0 +1,64 @@ + +# V1 Order + +V1Order + +## Structure + +`V1Order` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| null \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | +| `id` | `string \| undefined` | Optional | The order's unique identifier. | +| `buyerEmail` | `string \| null \| undefined` | Optional | The email address of the order's buyer. | +| `recipientName` | `string \| null \| undefined` | Optional | The name of the order's buyer. | +| `recipientPhoneNumber` | `string \| null \| undefined` | Optional | The phone number to use for the order's delivery. | +| `state` | [`string \| undefined`](../../doc/models/v1-order-state.md) | Optional | - | +| `shippingAddress` | [`Address \| undefined`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | +| `subtotalMoney` | [`V1Money \| undefined`](../../doc/models/v1-money.md) | Optional | - | +| `totalShippingMoney` | [`V1Money \| undefined`](../../doc/models/v1-money.md) | Optional | - | +| `totalTaxMoney` | [`V1Money \| undefined`](../../doc/models/v1-money.md) | Optional | - | +| `totalPriceMoney` | [`V1Money \| undefined`](../../doc/models/v1-money.md) | Optional | - | +| `totalDiscountMoney` | [`V1Money \| undefined`](../../doc/models/v1-money.md) | Optional | - | +| `createdAt` | `string \| undefined` | Optional | The time when the order was created, in ISO 8601 format. | +| `updatedAt` | `string \| undefined` | Optional | The time when the order was last modified, in ISO 8601 format. | +| `expiresAt` | `string \| null \| undefined` | Optional | The time when the order expires if no action is taken, in ISO 8601 format. | +| `paymentId` | `string \| null \| undefined` | Optional | The unique identifier of the payment associated with the order. | +| `buyerNote` | `string \| null \| undefined` | Optional | A note provided by the buyer when the order was created, if any. | +| `completedNote` | `string \| null \| undefined` | Optional | A note provided by the merchant when the order's state was set to COMPLETED, if any | +| `refundedNote` | `string \| null \| undefined` | Optional | A note provided by the merchant when the order's state was set to REFUNDED, if any. | +| `canceledNote` | `string \| null \| undefined` | Optional | A note provided by the merchant when the order's state was set to CANCELED, if any. | +| `tender` | [`V1Tender \| undefined`](../../doc/models/v1-tender.md) | Optional | 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. | +| `orderHistory` | [`V1OrderHistoryEntry[] \| null \| undefined`](../../doc/models/v1-order-history-entry.md) | Optional | The history of actions associated with the order. | +| `promoCode` | `string \| null \| undefined` | Optional | The promo code provided by the buyer, if any. | +| `btcReceiveAddress` | `string \| null \| undefined` | Optional | For Bitcoin transactions, the address that the buyer sent Bitcoin to. | +| `btcPriceSatoshi` | `number \| null \| undefined` | Optional | For Bitcoin transactions, the price of the buyer's order in satoshi (100 million satoshi equals 1 BTC). | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ], + "id": "id0", + "buyer_email": "buyer_email8", + "recipient_name": "recipient_name8", + "recipient_phone_number": "recipient_phone_number4" +} +``` + diff --git a/legacy/doc/models/v1-phone-number.md b/legacy/doc/models/v1-phone-number.md new file mode 100644 index 000000000..9531b0535 --- /dev/null +++ b/legacy/doc/models/v1-phone-number.md @@ -0,0 +1,25 @@ + +# V1 Phone Number + +Represents a phone number. + +## Structure + +`V1PhoneNumber` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `callingCode` | `string` | Required | The phone number's international calling code. For US phone numbers, this value is +1. | +| `number` | `string` | Required | The phone number. | + +## Example (as JSON) + +```json +{ + "calling_code": "calling_code0", + "number": "number4" +} +``` + diff --git a/legacy/doc/models/v1-tender-card-brand.md b/legacy/doc/models/v1-tender-card-brand.md new file mode 100644 index 000000000..cf0508a98 --- /dev/null +++ b/legacy/doc/models/v1-tender-card-brand.md @@ -0,0 +1,23 @@ + +# V1 Tender Card Brand + +The brand of a credit card. + +## Enumeration + +`V1TenderCardBrand` + +## Fields + +| Name | +| --- | +| `OTHER_BRAND` | +| `VISA` | +| `MASTER_CARD` | +| `AMERICAN_EXPRESS` | +| `DISCOVER` | +| `DISCOVER_DINERS` | +| `JCB` | +| `CHINA_UNIONPAY` | +| `SQUARE_GIFT_CARD` | + diff --git a/legacy/doc/models/v1-tender-entry-method.md b/legacy/doc/models/v1-tender-entry-method.md new file mode 100644 index 000000000..749c522fd --- /dev/null +++ b/legacy/doc/models/v1-tender-entry-method.md @@ -0,0 +1,19 @@ + +# V1 Tender Entry Method + +## Enumeration + +`V1TenderEntryMethod` + +## Fields + +| Name | +| --- | +| `MANUAL` | +| `SCANNED` | +| `SQUARE_CASH` | +| `SQUARE_WALLET` | +| `SWIPED` | +| `WEB_FORM` | +| `OTHER` | + diff --git a/legacy/doc/models/v1-tender-type.md b/legacy/doc/models/v1-tender-type.md new file mode 100644 index 000000000..df7b569bc --- /dev/null +++ b/legacy/doc/models/v1-tender-type.md @@ -0,0 +1,20 @@ + +# V1 Tender Type + +## Enumeration + +`V1TenderType` + +## Fields + +| Name | +| --- | +| `CREDIT_CARD` | +| `CASH` | +| `THIRD_PARTY_CARD` | +| `NO_SALE` | +| `SQUARE_WALLET` | +| `SQUARE_GIFT_CARD` | +| `UNKNOWN` | +| `OTHER` | + diff --git a/legacy/doc/models/v1-tender.md b/legacy/doc/models/v1-tender.md new file mode 100644 index 000000000..aaf542f15 --- /dev/null +++ b/legacy/doc/models/v1-tender.md @@ -0,0 +1,63 @@ + +# V1 Tender + +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. + +## Structure + +`V1Tender` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | The tender's unique ID. | +| `type` | [`string \| undefined`](../../doc/models/v1-tender-type.md) | Optional | - | +| `name` | `string \| null \| undefined` | Optional | A human-readable description of the tender. | +| `employeeId` | `string \| null \| undefined` | Optional | The ID of the employee that processed the tender. | +| `receiptUrl` | `string \| null \| undefined` | Optional | The URL of the receipt for the tender. | +| `cardBrand` | [`string \| undefined`](../../doc/models/v1-tender-card-brand.md) | Optional | The brand of a credit card. | +| `panSuffix` | `string \| null \| undefined` | Optional | The last four digits of the provided credit card's account number. | +| `entryMethod` | [`string \| undefined`](../../doc/models/v1-tender-entry-method.md) | Optional | - | +| `paymentNote` | `string \| null \| undefined` | Optional | Notes entered by the merchant about the tender at the time of payment, if any. Typically only present for tender with the type: OTHER. | +| `totalMoney` | [`V1Money \| undefined`](../../doc/models/v1-money.md) | Optional | - | +| `tenderedMoney` | [`V1Money \| undefined`](../../doc/models/v1-money.md) | Optional | - | +| `tenderedAt` | `string \| null \| undefined` | Optional | The time when the tender was created, in ISO 8601 format. | +| `settledAt` | `string \| null \| undefined` | Optional | The time when the tender was settled, in ISO 8601 format. | +| `changeBackMoney` | [`V1Money \| undefined`](../../doc/models/v1-money.md) | Optional | - | +| `refundedMoney` | [`V1Money \| undefined`](../../doc/models/v1-money.md) | Optional | - | +| `isExchange` | `boolean \| null \| undefined` | Optional | 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. | + +## Example (as JSON) + +```json +{ + "id": "id6", + "type": "SQUARE_WALLET", + "name": "name6", + "employee_id": "employee_id4", + "receipt_url": "receipt_url2" +} +``` + diff --git a/legacy/doc/models/v1-update-order-request-action.md b/legacy/doc/models/v1-update-order-request-action.md new file mode 100644 index 000000000..6fd004a5b --- /dev/null +++ b/legacy/doc/models/v1-update-order-request-action.md @@ -0,0 +1,15 @@ + +# V1 Update Order Request Action + +## Enumeration + +`V1UpdateOrderRequestAction` + +## Fields + +| Name | +| --- | +| `COMPLETE` | +| `CANCEL` | +| `REFUND` | + diff --git a/legacy/doc/models/v1-update-order-request.md b/legacy/doc/models/v1-update-order-request.md new file mode 100644 index 000000000..0f8973be1 --- /dev/null +++ b/legacy/doc/models/v1-update-order-request.md @@ -0,0 +1,31 @@ + +# V1 Update Order Request + +V1UpdateOrderRequest + +## Structure + +`V1UpdateOrderRequest` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `action` | [`string`](../../doc/models/v1-update-order-request-action.md) | Required | - | +| `shippedTrackingNumber` | `string \| null \| undefined` | Optional | The tracking number of the shipment associated with the order. Only valid if action is COMPLETE. | +| `completedNote` | `string \| null \| undefined` | Optional | A merchant-specified note about the completion of the order. Only valid if action is COMPLETE. | +| `refundedNote` | `string \| null \| undefined` | Optional | A merchant-specified note about the refunding of the order. Only valid if action is REFUND. | +| `canceledNote` | `string \| null \| undefined` | Optional | A merchant-specified note about the canceling of the order. Only valid if action is CANCEL. | + +## Example (as JSON) + +```json +{ + "action": "COMPLETE", + "shipped_tracking_number": "shipped_tracking_number4", + "completed_note": "completed_note4", + "refunded_note": "refunded_note8", + "canceled_note": "canceled_note6" +} +``` + diff --git a/legacy/doc/models/vendor-contact.md b/legacy/doc/models/vendor-contact.md new file mode 100644 index 000000000..38cf1b6b8 --- /dev/null +++ b/legacy/doc/models/vendor-contact.md @@ -0,0 +1,33 @@ + +# Vendor Contact + +Represents a contact of a [Vendor](../../doc/models/vendor.md). + +## Structure + +`VendorContact` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | A unique Square-generated ID for the [VendorContact](entity:VendorContact).
This field is required when attempting to update a [VendorContact](entity:VendorContact).
**Constraints**: *Maximum Length*: `100` | +| `name` | `string \| null \| undefined` | Optional | The name of the [VendorContact](entity:VendorContact).
This field is required when attempting to create a [Vendor](entity:Vendor).
**Constraints**: *Maximum Length*: `255` | +| `emailAddress` | `string \| null \| undefined` | Optional | The email address of the [VendorContact](entity:VendorContact).
**Constraints**: *Maximum Length*: `255` | +| `phoneNumber` | `string \| null \| undefined` | Optional | The phone number of the [VendorContact](entity:VendorContact).
**Constraints**: *Maximum Length*: `255` | +| `removed` | `boolean \| null \| undefined` | Optional | The state of the [VendorContact](entity:VendorContact). | +| `ordinal` | `number` | Required | The ordinal of the [VendorContact](entity:VendorContact). | + +## Example (as JSON) + +```json +{ + "id": "id0", + "name": "name0", + "email_address": "email_address8", + "phone_number": "phone_number8", + "removed": false, + "ordinal": 244 +} +``` + diff --git a/legacy/doc/models/vendor-status.md b/legacy/doc/models/vendor-status.md new file mode 100644 index 000000000..11bb2813c --- /dev/null +++ b/legacy/doc/models/vendor-status.md @@ -0,0 +1,17 @@ + +# Vendor Status + +The status of the [Vendor](../../doc/models/vendor.md), +whether a [Vendor](../../doc/models/vendor.md) is active or inactive. + +## Enumeration + +`VendorStatus` + +## Fields + +| Name | Description | +| --- | --- | +| `ACTIVE` | Vendor is active and can receive purchase orders. | +| `INACTIVE` | Vendor is inactive and cannot receive purchase orders. | + diff --git a/legacy/doc/models/vendor.md b/legacy/doc/models/vendor.md new file mode 100644 index 000000000..330838714 --- /dev/null +++ b/legacy/doc/models/vendor.md @@ -0,0 +1,42 @@ + +# Vendor + +Represents a supplier to a seller. + +## Structure + +`Vendor` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | A unique Square-generated ID for the [Vendor](entity:Vendor).
This field is required when attempting to update a [Vendor](entity:Vendor).
**Constraints**: *Maximum Length*: `100` | +| `createdAt` | `string \| undefined` | Optional | An RFC 3339-formatted timestamp that indicates when the
[Vendor](entity:Vendor) was created.
**Constraints**: *Maximum Length*: `34` | +| `updatedAt` | `string \| undefined` | Optional | An RFC 3339-formatted timestamp that indicates when the
[Vendor](entity:Vendor) was last updated.
**Constraints**: *Maximum Length*: `34` | +| `name` | `string \| null \| undefined` | Optional | The name of the [Vendor](entity:Vendor).
This field is required when attempting to create or update a [Vendor](entity:Vendor).
**Constraints**: *Maximum Length*: `100` | +| `address` | [`Address \| undefined`](../../doc/models/address.md) | Optional | Represents a postal address in a country.
For more information, see [Working with Addresses](https://developer.squareup.com/docs/build-basics/working-with-addresses). | +| `contacts` | [`VendorContact[] \| null \| undefined`](../../doc/models/vendor-contact.md) | Optional | The contacts of the [Vendor](entity:Vendor). | +| `accountNumber` | `string \| null \| undefined` | Optional | The account number of the [Vendor](entity:Vendor).
**Constraints**: *Maximum Length*: `100` | +| `note` | `string \| null \| undefined` | Optional | A note detailing information about the [Vendor](entity:Vendor).
**Constraints**: *Maximum Length*: `4096` | +| `version` | `number \| undefined` | Optional | The version of the [Vendor](entity:Vendor). | +| `status` | [`string \| undefined`](../../doc/models/vendor-status.md) | Optional | The status of the [Vendor](../../doc/models/vendor.md),
whether a [Vendor](../../doc/models/vendor.md) is active or inactive. | + +## Example (as JSON) + +```json +{ + "id": "id8", + "created_at": "created_at6", + "updated_at": "updated_at4", + "name": "name8", + "address": { + "address_line_1": "address_line_16", + "address_line_2": "address_line_26", + "address_line_3": "address_line_32", + "locality": "locality6", + "sublocality": "sublocality6" + } +} +``` + diff --git a/legacy/doc/models/visibility-filter.md b/legacy/doc/models/visibility-filter.md new file mode 100644 index 000000000..d39343bc1 --- /dev/null +++ b/legacy/doc/models/visibility-filter.md @@ -0,0 +1,17 @@ + +# Visibility Filter + +Enumeration of visibility-filter values used to set the ability to view custom attributes or custom attribute definitions. + +## Enumeration + +`VisibilityFilter` + +## Fields + +| Name | Description | +| --- | --- | +| `ALL` | All custom attributes or custom attribute definitions. | +| `READ` | All custom attributes or custom attribute definitions with the `visibility` field set to `VISIBILITY_READ_ONLY` or `VISIBILITY_READ_WRITE_VALUES`. | +| `READ_WRITE` | All custom attributes or custom attribute definitions with the `visibility` field set to `VISIBILITY_READ_WRITE_VALUES`. | + diff --git a/legacy/doc/models/void-transaction-response.md b/legacy/doc/models/void-transaction-response.md new file mode 100644 index 000000000..5520bba56 --- /dev/null +++ b/legacy/doc/models/void-transaction-response.md @@ -0,0 +1,43 @@ + +# Void Transaction Response + +Defines the fields that are included in the response body of +a request to the [VoidTransaction](api-endpoint:Transactions-VoidTransaction) endpoint. + +## Structure + +`VoidTransactionResponse` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `errors` | [`Error[] \| undefined`](../../doc/models/error.md) | Optional | Any errors that occurred during the request. | + +## Example (as JSON) + +```json +{ + "errors": [ + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + }, + { + "category": "MERCHANT_SUBSCRIPTION_ERROR", + "code": "INVALID_EXPIRATION", + "detail": "detail6", + "field": "field4" + } + ] +} +``` + diff --git a/legacy/doc/models/wage-setting.md b/legacy/doc/models/wage-setting.md new file mode 100644 index 000000000..993088b17 --- /dev/null +++ b/legacy/doc/models/wage-setting.md @@ -0,0 +1,76 @@ + +# Wage Setting + +Represents information about the overtime exemption status, job assignments, and compensation +for a [team member](../../doc/models/team-member.md). + +## Structure + +`WageSetting` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `teamMemberId` | `string \| null \| undefined` | Optional | The ID of the team member associated with the wage setting. | +| `jobAssignments` | [`JobAssignment[] \| null \| undefined`](../../doc/models/job-assignment.md) | Optional | **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. | +| `isOvertimeExempt` | `boolean \| null \| undefined` | Optional | Whether the team member is exempt from the overtime rules of the seller's country. | +| `version` | `number \| undefined` | Optional | **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). | +| `createdAt` | `string \| undefined` | Optional | The timestamp when the wage setting was created, in RFC 3339 format. | +| `updatedAt` | `string \| undefined` | Optional | The timestamp when the wage setting was last updated, in RFC 3339 format. | + +## Example (as JSON) + +```json +{ + "team_member_id": "team_member_id2", + "job_assignments": [ + { + "job_title": "job_title6", + "pay_type": "SALARY", + "hourly_rate": { + "amount": 172, + "currency": "LAK" + }, + "annual_rate": { + "amount": 232, + "currency": "NIO" + }, + "weekly_hours": 98, + "job_id": "job_id2" + }, + { + "job_title": "job_title6", + "pay_type": "SALARY", + "hourly_rate": { + "amount": 172, + "currency": "LAK" + }, + "annual_rate": { + "amount": 232, + "currency": "NIO" + }, + "weekly_hours": 98, + "job_id": "job_id2" + }, + { + "job_title": "job_title6", + "pay_type": "SALARY", + "hourly_rate": { + "amount": 172, + "currency": "LAK" + }, + "annual_rate": { + "amount": 232, + "currency": "NIO" + }, + "weekly_hours": 98, + "job_id": "job_id2" + } + ], + "is_overtime_exempt": false, + "version": 140, + "created_at": "created_at0" +} +``` + diff --git a/legacy/doc/models/webhook-subscription.md b/legacy/doc/models/webhook-subscription.md new file mode 100644 index 000000000..80c8bdd4a --- /dev/null +++ b/legacy/doc/models/webhook-subscription.md @@ -0,0 +1,38 @@ + +# Webhook Subscription + +Represents the details of a webhook subscription, including notification URL, +event types, and signature key. + +## Structure + +`WebhookSubscription` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | A Square-generated unique ID for the subscription.
**Constraints**: *Maximum Length*: `64` | +| `name` | `string \| null \| undefined` | Optional | The name of this subscription.
**Constraints**: *Maximum Length*: `64` | +| `enabled` | `boolean \| null \| undefined` | Optional | Indicates whether the subscription is enabled (`true`) or not (`false`). | +| `eventTypes` | `string[] \| null \| undefined` | Optional | The event types associated with this subscription. | +| `notificationUrl` | `string \| null \| undefined` | Optional | The URL to which webhooks are sent. | +| `apiVersion` | `string \| null \| undefined` | Optional | The API version of the subscription.
This field is optional for `CreateWebhookSubscription`.
The value defaults to the API version used by the application. | +| `signatureKey` | `string \| undefined` | Optional | The Square-generated signature key used to validate the origin of the webhook event. | +| `createdAt` | `string \| undefined` | Optional | The timestamp of when the subscription was created, in RFC 3339 format. For example, "2016-09-04T23:59:33.123Z". | +| `updatedAt` | `string \| undefined` | Optional | The timestamp of when the subscription was last updated, in RFC 3339 format.
For example, "2016-09-04T23:59:33.123Z". | + +## Example (as JSON) + +```json +{ + "id": "id8", + "name": "name8", + "enabled": false, + "event_types": [ + "event_types6" + ], + "notification_url": "notification_url2" +} +``` + diff --git a/legacy/doc/models/weekday.md b/legacy/doc/models/weekday.md new file mode 100644 index 000000000..308543ff6 --- /dev/null +++ b/legacy/doc/models/weekday.md @@ -0,0 +1,21 @@ + +# Weekday + +The days of the week. + +## Enumeration + +`Weekday` + +## Fields + +| Name | Description | +| --- | --- | +| `MON` | Monday | +| `TUE` | Tuesday | +| `WED` | Wednesday | +| `THU` | Thursday | +| `FRI` | Friday | +| `SAT` | Saturday | +| `SUN` | Sunday | + diff --git a/legacy/doc/models/workweek-config.md b/legacy/doc/models/workweek-config.md new file mode 100644 index 000000000..2ba7e1efe --- /dev/null +++ b/legacy/doc/models/workweek-config.md @@ -0,0 +1,34 @@ + +# Workweek Config + +Sets the day of the week and hour of the day that a business starts a +workweek. This is used to calculate overtime pay. + +## Structure + +`WorkweekConfig` + +## Fields + +| Name | Type | Tags | Description | +| --- | --- | --- | --- | +| `id` | `string \| undefined` | Optional | The UUID for this object. | +| `startOfWeek` | [`string`](../../doc/models/weekday.md) | Required | The days of the week. | +| `startOfDayLocalTime` | `string` | Required | 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).
**Constraints**: *Minimum Length*: `1` | +| `version` | `number \| undefined` | Optional | 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. | +| `createdAt` | `string \| undefined` | Optional | A read-only timestamp in RFC 3339 format; presented in UTC. | +| `updatedAt` | `string \| undefined` | Optional | A read-only timestamp in RFC 3339 format; presented in UTC. | + +## Example (as JSON) + +```json +{ + "id": "id4", + "start_of_week": "SUN", + "start_of_day_local_time": "start_of_day_local_time0", + "version": 104, + "created_at": "created_at2", + "updated_at": "updated_at0" +} +``` + diff --git a/legacy/exports/index.d.mts b/legacy/exports/index.d.mts new file mode 100644 index 000000000..d4a3b9f49 --- /dev/null +++ b/legacy/exports/index.d.mts @@ -0,0 +1 @@ +export * from "square-legacy"; \ No newline at end of file diff --git a/legacy/exports/index.d.ts b/legacy/exports/index.d.ts new file mode 100644 index 000000000..d4a3b9f49 --- /dev/null +++ b/legacy/exports/index.d.ts @@ -0,0 +1 @@ +export * from "square-legacy"; \ No newline at end of file diff --git a/legacy/exports/index.js b/legacy/exports/index.js new file mode 100644 index 000000000..de8433c9d --- /dev/null +++ b/legacy/exports/index.js @@ -0,0 +1 @@ +module.exports = require("square-legacy"); \ No newline at end of file diff --git a/legacy/exports/index.mjs b/legacy/exports/index.mjs new file mode 100644 index 000000000..d4a3b9f49 --- /dev/null +++ b/legacy/exports/index.mjs @@ -0,0 +1 @@ +export * from "square-legacy"; \ No newline at end of file